Advertisement
Guest User

Untitled

a guest
Oct 30th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. -- create the deathcounter variable with LIT
  2. local roomDC = Deaths( )
  3. roomDC:SetUnit( "Terran Physics Lab" )
  4. roomDC:SetPlayer( 8 )
  5.  
  6. local screen = "Move Screen 1"
  7. local oldScreen = "Old Screen 1"
  8.  
  9. function ConnectOneWay( a, b, g )
  10.     p1:Conditions( )
  11.     roomDC:SetCount( 0 )
  12.     roomDC:Exactly( )
  13.     BringExactly( 1, LINK, a, 1 )
  14.     p1:Actions( )
  15.     roomDC:SetCount( 1 )
  16.     roomDC:SetTo( )
  17.     CenterLocation( oldScreen, 1, LINK, "Anywhere" )
  18.     CenterLocation( oldScreen, NEUTRAL_PLAYER, "Protoss Observer", oldScreen )
  19.     MoveUnit( 1, LINK, 1, a, b )
  20.     CenterLocation( screen, 1, LINK, "Anywhere" )
  21.     CenterLocation( screen, NEUTRAL_PLAYER, "Protoss Observer", screen )
  22.     onRoomEnter[ 1 ]:Set( )
  23.     MoveScreen( screen )
  24.     PlayWAV( "staredit/wav/LTTP_Door.wav" )
  25.     if g then Text( "<13><1C>:: <4>" .. g .. " <1C>::" ) end
  26.     Preserve( )
  27. end
  28.  
  29. -- function that generates triggers to connect two locations
  30. -- together to act as a doorway for a "hero unit" called LINK
  31. function ConnectRooms( a, b, greetA, greetB )
  32.     -- move from a to b
  33.     ConnectOneWay( a, b, greetA )
  34.    
  35.     -- move from b to a
  36.     ConnectOneWay( b, a, greetB )
  37.    
  38.     -- turn off the DC when not present at a or b
  39.     p1:Conditions( )
  40.     BringExactly( 1, LINK, a, 0 )
  41.     BringExactly( 1, LINK, b, 0 )
  42.     roomDC:SetCount( 1 )
  43.     roomDC:Exactly( )
  44.     p1:Actions( )
  45.     roomDC:SetCount( 0 )
  46.     roomDC:SetTo( )
  47.     Preserve( )
  48. end
  49.  
  50. ConnectRooms( "link's house a", "link's house b", "Link's House", "Hyrule Grounds" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement