Paste #30585: Conquest

Date: 2016/02/20 12:24:36 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CapturePoints:
  type: world
  events:
    on player enters CapturePoint1:
    - narrate "<&c><&l>[Conquest] <&6>You've entered a capture point!"
    - sidebar set "title:<&c><&n><&l>Conquest" "values:<&7><&m>-----------------------------|<&6>Round: <&e><server.flag[RoundCounter].round>/5|<&6>Time: <&e><server.flag[RoundCounter].round> seconds|<&7><&m>-----------------------------<&0>|<&a>Aloreh: <&e><server.flag[AlorehCount].round>|<&a>Ar-Selukk: <&e><server.flag[ArSelukkCount].round>|<&a>Vrovona: <&e><server.flag[VrovonaCount].round>|<&a>Ithero: <&e><server.flag[ItheroCount].round>|<&a>Roreg Logh: <&e><server.flag[RoregCount].round>|<&a>The Daggerlands: <&e><server.flag[DaggerlandsCount].round>" "start:9" "increment:-1"
    on player exits CapturePoint1:
    - narrate "<&c><&l>[Conquest] <&6>You've left a capture point!"
    - sidebar remove

ConquestManager:
  type: task
  script:
  - note cu@-628,90,244,world|-649,50,265,world as:CapturePoint1
  - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:0
  - flag server RoundCounter:0
  - flag server AlorehCount:0
  - flag server RoregCount:0
  - flag server ArSelukkCount:0
  - flag server VrovonaCount:0
  - flag server ItheroCount:0
  - flag server DaggerlandsCount:0
  - announce "<&c><&l>[Conquest] <&6>The capture point will unlock in 1 minute!"
  - wait 30s
  - announce "<&c><&l>[Conquest] <&6>The capture point will unlock in 30 seconds!"
  - wait 15s
  - announce "<&c><&l>[Conquest] <&6>The capture point will unlock in 15 seconds!"
  - wait 15s
  - announce "<&c><&l>[Conquest] <&6>The fight for the capture point has started!"
  - repeat 5 {
      - run Capturing_Process
      }
  - run CapturingResult
  - flag server RoundCounter:0
  - flag server AlorehCount:0
  - flag server RoregCount:0
  - flag server ArSelukkCount:0
  - flag server VrovonaCount:0
  - flag server ItheroCount:0
  - flag server DaggerlandsCount:0

CapturingResult:
  type: task
  speed: 10t
  script:
  - foreach li@AlorehCount|VrovonaCount|ItheroCount|DaggerlandsCount|ArSelukkCount|RoregCount {
    - if <server.flag[<def[value]>]||0> >= <server.flag[<def[highest]||<def[value]>>]||0> {
      - define highest <def[value]>
      }
  }
  - title "title:<&c><&l><def[highest].before[count]> wins!" "subtitle:<&6>The capture point will unlock in 60 minutes" targets:<cu@capturepoint1.list_players>
  - announce "<&c><&l>[Conquest] <&6><def[highest].before[count]> has conquered the capture point!"
  - sidebar set "title:<&c><&n><&l>Conquest" "values:<&7><&m>-----------------------------|<&6>Round: <&e><server.flag[RoundCounter].round>/5|<&6>Time: <&e><server.flag[RoundCounter].round> seconds|<&7><&m>-----------------------------<&0>|<&a>Aloreh: <&e><server.flag[AlorehCount].round>|<&a>Ar-Selukk: <&e><server.flag[ArSelukkCount].round>|<&a>Vrovona: <&e><server.flag[VrovonaCount].round>|<&a>Ithero: <&e><server.flag[ItheroCount].round>|<&a>Roreg Logh: <&e><server.flag[RoregCount].round>|<&a>The Daggerlands: <&e><server.flag[DaggerlandsCount].round>" "start:9" "increment:-1"
  - choose "<def[highest]>":
      - case "VrovonaCount":
        - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:1
      - case "ItheroCount":
        - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:9
      - case "AlorehCount":
        - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:11
      - case "ArSelukkCount":
        - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:4
      - case "DaggerlandsCount":
        - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:14
      - case "RoregCount":
        - modifyblock <l@-1067,125,-1063,world> minecraft:stained_glass:10

Capturing_Process:
  type: task
  speed: 10t
  script:
  - flag server RoundCounter:+:1
  - wait 10
  - foreach <cu@capturepoint1.list_players> {
    - if <def[Value].has_flag[Aloreh]> {
      - flag server AlorehCount:+:1
    }
    else if <def[Value].has_flag[Roreg]> {
      - flag server RoregCount:+:1
    }
    else if <def[Value].has_flag[Vrovona]> {
      - flag server VrovonaCount:+:1
    }
    else if <def[Value].has_flag[ArSelukk]> {
      - flag server ArSelukkCount:+:1
    }
    else if <def[Value].has_flag[Daggerlands]> {
      - flag server DaggerlandsCount:+:1
    }
    else if <def[Value].has_flag[Ithero]> {
      - flag server ItheroCount:+:1
    }
  }
  - actionbar "<&6><&l>Round <server.flag[RoundCounter].round> is over!" targets:<cu@CapturePoint1.list_players>
  - narrate "<&c><&l>[Conquest] <&6>Round <server.flag[RoundCounter].round> is over!" targets:<cu@CapturePoint1.list_players>
  - sidebar set "title:<&c><&n><&l>Conquest" "values:<&7><&m>-----------------------------|<&6>Round: <&e><server.flag[RoundCounter].round>/5|<&6>Time: <&e><server.flag[RoundCounter].round> seconds|<&7><&m>-----------------------------<&0>|<&a>Aloreh: <&e><server.flag[AlorehCount].round>|<&a>Ar-Selukk: <&e><server.flag[ArSelukkCount].round>|<&a>Vrovona: <&e><server.flag[VrovonaCount].round>|<&a>Ithero: <&e><server.flag[ItheroCount].round>|<&a>Roreg Logh: <&e><server.flag[RoregCount].round>|<&a>The Daggerlands: <&e><server.flag[DaggerlandsCount].round>" "start:9" "increment:-1"