Paste #17418: applicationsystem

Date: 2015/07/05 11:00:47 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


spawnhubapply:
    type: assignment
    interact scripts:
    - 1 spawnHubApplyInteract
    actions:
    - trigger name:chat toggle:true
    - trigger name:click toggle:true
    - trigger name:proximity toggle:true

spawnHubApplyInteract:
    type: interact
    steps:
        1:
            proximity trigger:
                entry:
                    script:
                    - flag player "cont:false"
                    - flag player "chatSel:1"
                    - run spawnHubApplyChatNav
            chat trigger:
                1:
                    trigger: //
                    script:
                    - flag player "cont:true"
                    - run spawnHubApplyChatNav
            click trigger:
                script:
                - flag player "cont:false"
                - run spawnHubApplyChatNav

spawnHubApplyChatNav:
    type: task
    script:
        - if <player.flag[cont]> == true {
            - if <player.chat_history> == Z {
                - flag player "chatSel:2"
                } else if <player.chat_history> == Y {
                - flag player "chatSel:<player.flag[_chatSel]>"
                } else {
                - flag player "_chatSel:<player.flag[chatSel]>"
                - flag player "chatSel:<player.flag[chatSel]><player.chat_history>"
                }
            }
        - if <player.flag[chatSelect]> == 1 {
            - chat "Oh, cool so you are interested in becoming a builder on <white>Fixiebrick<green>?"
            - ^narrate "type the number of the option you want in the chat."
            - ^narrate "1. Yes"
            - ^narrate "2. No"
            } else if <player.flag[chatSelect]> == 11 {
            - if <player.flag[application]> != 1 && <player.flag[application]> != 2 && <player.flag[application]> != 3 {
                - chat "Oke, then let me explain what being a builder on <white>fixiebrick<green> means for you!"
                - wait 3
                - chat "Being a builder on <white>Fixiebrick<green> is not easy, you have to qualify through this application process."
                - wait 4
                - chat "Most of the applications are denied because of lack on quality."
                - wait 3
                - chat "We do not care for your speed, we care for the quality that you build!"
                - wait 4
                - chat "The server is medieval and steampunk style, so that's the style you need to build."
                - wait 4
                - chat "If you want to do a application, you get a plot, and can do your application on that plot."
                - wait 4
                - chat "On your own plot you will be able to worldedit."
                - wait 4
                - chat "Do you want to Apply?"
                - ^narrate "type the number of the option you want in the chat."
                - ^narrate "1. Yes"
                - ^narrate "2. No"
                } else if <player.flag[application]> == 1 || <player.flag[application]> == 2 || <player.flag[application]> == 3 {
                - chat "Hmm, it seems that you don't need to start a application anymore <white><player.name>!"
                - wait 4
                - chat "Shall i teleport you to your plot?"
                - ^narrate "type the number of the option you want in the chat."
                - ^narrate "1. Yes"
                - ^narrate "2. No"
                }
            } else if <player.flag[chatSelect]> == 111 {
            - if <player.flag[application]> != 1 && <player.flag[application]> != 2 && <player.flag[application]> != 3 {
                - chat "Great!"
                - wait 1
                - chat "Oke, i will now bring you to your plot,"
                - wait 2
                - flag player "application:1"
                - execute as_op "warp plotworld"
                - execute as_server "pex user <player.name> group set Applicant"
                - execute as_player "plotme auto"
                - wait 1
                - create player Trainer <player.location.add[0,0,5]>
                - execute as_op "npc sel"
                - execute as_op "npc assignment --set plothelperassignment"
                - execute as_op "npc look"
                - flag player "personalplottrainer:<npc.id>"
                } else if <player.flag[application> == 1 || <player.flag[application]> == 2 {
                - execute as_player "plotme home"
                - chat "There you go, back on your plot!"
                } else if <player.flag[application]> == 3 {
                - chat "I'm sorry, you completed your application before, and you have no plot anymore."
                }
            } else if <player.flag[chatSelect]> == 112 {
            - chat "Oke, hope to see you some other time!"
            } else if <player.flag[chatSelect]> == 12 {
            - flag player "chatSelect:2"
            - flag player "repeatLast:true"
            - run spawnhubapplychatnav
            } else if <player.flag[chatSelect]> == 2 {
            - random {
                - chat "<green>Goodbye <white><player.name><green>."
                - chat "<green>Goodbye <white><player.name><green>, hope I helped!"
                - chat "<green>Hope to see you around <white><player.name><green>."
                - chat "<green>Hope I helped <white><player.name><green>."}
                - flag player "chatSelect:1"
            } else {
            - chat "<green>Error! Unknown chat path... contact admin / technician"
            - announce to_ops "Error! Unknown chat path; guardInteract, <player.flag[repeatLast]> + <player.flag[chatSelect]> + <player.chat_history>"
            }
            - narrate "Y. Back"
            - narrate "Z. Exit"