Paste #7229: test4

Date: 2014/07/21 10:48:41 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# +----------------------------------
# |   Region World Script
# +----------------------------------

Regions_Script:
    type: world
    events:
# +----------------------------------
# |   Server Start
# +----------------------------------
        on server start:
# |   Cuboid gates
        - flag server Cathar_South_Gate:0
        - flag server Cathar_West_Gate:0
        - flag server Cathar_North_Gate:0
        - note cu@l@9364,30,5874,world|l@9349,50,5825,world as:Cathar_South_Gate
# |   Cuboid Mines
        - note cu@l@6832,31,7437,world|l@6837,27,7437,world as:Lindorthell_Mine_W
        - note cu@l@-696,195,-687,resources|l@-691,199,-687,resources as:Lindorthell_Mine_R
        - note cu@l@1303,37,5475,world|l@1303,33,5485,world as:Orgoroth_Mine_W
        - note cu@l@1302,34,5474,world|l@1298,37,5475,world as:Orgoroth_Mine_W2
        - note cu@l@-679,18,674,resources|l@-681,184,676,resources as:Orgoroth_Mine_R
        - note cu@l@-688,193,671,resources|l@-683,190,679,resources as:Orgoroth_Mine_R2
# +----------------------------------
# |   Cathar Regions
# +----------------------------------
        on player enters cu@Cathar_South_Gate:
        - if <server.flag[Cathar_South_Gate]> > -1 {
          - flag server Cathar_South_Gate:++
          - run Cathar_South_Gate_Task
          }

        on player exits cu@Cathar_South_Gate:
        - if <server.flag[Cathar_South_Gate]> > 0 {
          - flag server Cathar_South_Gate:--
          - run Cathar_South_Gate_Task
          }
# +----------------------------------
# |   Mines
# +----------------------------------
# |   Lindorthell
        on player enters cu@Lindorthell_Mine_W:
        - teleport <player.name> -693,194,-682,resources
        on player enters cu@Lindorthell_Mine_R:
        - teleport <player.name> 6834,30,7433,world
        - look <player> 6831,35,7427,world
# |   Orgoroth
        on player enters cu@Orgoroth_Mine_W:
        - teleport <player.name> -677,180,675,resources
        - look <player> -673,184,665,resources
        on player enters cu@Orgoroth_Mine_W2:
        - teleport <player.name> -684,190,670,resources
        - look <player> -669,184,654,resources
        on player enters cu@Orgoroth_Mine_R:
        - teleport <player.name> 1302,34,5478,world
        - look <player> 1292,40,5482,world
        on player enters cu@Orgoroth_Mine_R2:
        - teleport <player.name> 1301,34,5476,world
        - look <player> 1292,40,5482,world
Cathar_South_Gate_Task:
    type: task
    Script:
      - if <server.flag[Cathar_South_Gate]> > -1 {
        - if !<server.flag[Cathar_South_Gate_Engaged]> {
          - if !<server.flag[Cathar_South_Gate_Open]> {
            - flag server Cathar_South_Gate_Closed:!
            - flag server Cathar_South_Gate_Open:!
            - flag server Cathar_South_Gate_Engaged duration:4s
            - execute as_server "rb rebuild southgate1"
            - wait 0.5s
            - execute as_server "rb rebuild southgate2"
            - wait 0.5s
            - execute as_server "rb rebuild southgate3"
            - wait 0.5s
            - execute as_server "rb rebuild southgate4"
            - wait 0.5s
            - execute as_server "rb rebuild southgate5"
            - wait 0.5s
            - execute as_server "rb rebuild southgate6"
            - flag server Cathar_South_Gate_Open
            - flag server Cathar_South_Gate_Closed:!
            }
          } else {
          - wait 5s
          - if !<server.flag[Cathar_South_Gate_Open]> {
            - if !<server.flag[Cathar_South_Gate_Engaged]> {
              - flag server Cathar_South_Gate_Closed:!
              - flag server Cathar_South_Gate_Open:!
              - flag server Cathar_South_Gate_Engaged duration:4s
              - execute as_server "rb rebuild southgate1"
              - wait 0.5s
              - execute as_server "rb rebuild southgate2"
              - wait 0.5s
              - execute as_server "rb rebuild southgate3"
              - wait 0.5s
              - execute as_server "rb rebuild southgate4"
              - wait 0.5s
              - execute as_server "rb rebuild southgate5"
              - wait 0.5s
              - execute as_server "rb rebuild southgate6"
              - flag server Cathar_South_Gate_Open
              - flag server Cathar_South_Gate_Closed:!
              } else {
              - wait 5s
              - run Cathar_South_Gate_Task
              }
            }
          }
        }
      - if <server.flag[Cathar_South_Gate]> == 0 {
        - if !<server.flag[Cathar_South_Gate_Engaged]> {
          - if !<server.flag[Cathar_South_Gate_Closed]> {
            - flag server Cathar_South_Gate_Open:!
            - flag server Cathar_South_Gate_Closed:!
            - flag server Cathar_South_Gate_Engaged duration:4s
            - execute as_server "rb rebuild southgate6"
            - wait 0.5s
            - execute as_server "rb rebuild southgate5"
            - wait 0.5s
            - execute as_server "rb rebuild southgate4"
            - wait 0.5s
            - execute as_server "rb rebuild southgate3"
            - wait 0.5s
            - execute as_server "rb rebuild southgate2"
            - wait 0.5s
            - execute as_server "rb rebuild southgate1"
            - flag server Cathar_South_Gate_Closed
            - flag server Cathar_South_Gate_Open:!
            }
          } else {
          - wait 5s
          - if !<server.flag[Cathar_South_Gate_Closed]> {
            - if !<server.flag[Cathar_South_Gate_Engaged]> {
              - flag server Cathar_South_Gate_Open:!
              - flag server Cathar_South_Gate_Closed:!
              - flag server Cathar_South_Gate_Engaged duration:4s
              - execute as_server "rb rebuild southgate6"
              - wait 0.5s
              - execute as_server "rb rebuild southgate5"
              - wait 0.5s
              - execute as_server "rb rebuild southgate4"
              - wait 0.5s
              - execute as_server "rb rebuild southgate3"
              - wait 0.5s
              - execute as_server "rb rebuild southgate2"
              - wait 0.5s
              - execute as_server "rb rebuild southgate1"
              - flag server Cathar_South_Gate_Closed
              - flag server Cathar_South_Gate_Open:!
              } else {
              - wait 5s
              - run Cathar_South_Gate_Task
              }
            }
          }
        }