Paste #8096: Test

Date: 2014/08/08 12:09:46 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# To assign to an NPC, literally type:
# /npc assign --set "prof_woodsman_selector"
prof_woodsman_selector:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:proximity state:true
        - trigger name:chat state:true
    interact scripts:
    - 10 prof_woodsman_interact

prof_woodsman_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.flag[prof]> == prof_woodsman {
                  - narrate format:cchat "Your profession is already woodsman, move on"
                  }
                  else {
                  - narrate format:cchat "<player.name> I can tell you about the Profession of <&4> Woodsman"
                  - narrate format:cchat "Do you want to hear what I have to say?"
                  - narrate format:cchat "You can say <&c>Yes <&f>or <&c>No"
                  }
            chat trigger:
                1:
                    trigger: /yes/ Tell me about the Woodsman.
                    script:
                    - narrate format:cchat "Woodsmen get special abilities and XP for cutting down trees and leaves that no one else get"
                    - wait 3
                    - narrate format:cchat "The Woodsman usually supports a group or town and sells his work and materials"
                    - wait 3
                    - narrate format:cchat "You also get some sweet Axe offensive abilities and XP as well <player.name>"
                    - wait 2
                    - narrate format:cchat "Do you want to cut trees and sell materials for a living on the server as a <&6>Woodsman<&f>?"
                    - narrate "You can say <&c>Join <&f>or <&c>Leave"
                2:
                    trigger: I want to /Join/ the Woodsmen and plant and cut trees with my mighty Axe 
                    script: 
                    - narrate format:cchat "You are now a <&6>Woodsman<&f>!" 
                    - if <player.flag[prof]||null> != null { 
                      - execute as_server "pex user <player.name> group remove fisherman" 
                      - execute as_server "pex user <player.name> group remove farmer" 
                      - execute as_server "pex user <player.name> group remove smithy" 
                      - execute as_server "pex user <player.name> group remove beastmaster" 
                      - execute as_server "pex user <player.name> group remove stoneflinger" 
                      - execute as_server "pex user <player.name> group remove archer" 
                      - execute as_server "pex user <player.name> group remove ranger" 
                      - execute as_server "pex user <player.name> group remove barbarian" 
                      } 
                    - flag player prof:prof_woodsman 
                    - execute as_server "pex user <player.name> group add woodsman" 
                3:
                    trigger: /No/, I will move on.
                    script:
                    - narrate format:cchat "Ok"
                4:
                    trigger: I think I will /leave/ and look at other professions.
                    script:
                    - narrate format:cchat "Goodbye"