Paste #42785: Untitled Paste

Date: 2017/06/22 08:48:52 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


my_npc:
    type: assignment
    actions:
        on assignment:
        - trigger name: click state:true
        - trigger name: chat state:true
    interact scripts:
    - 169 my_npc_interact

my_npc_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - chat "Salut tu veux que l'on essaie ?"
                - narrate "Dis oui ou non"
            chat trigger:
                1:
                    trigger: /Oui/ c'est d'accord
                    script:
                    - chat "Cool, suis moi !"
                    - ^create player MyNpc <npc.location> save:mynpc
                    - ^adjust <player> hide_entity:<np>
                    - ^adjust <server.list_online_players.exclude[<player>]> hide_entity:<entry[mynpc].created_npc>
                    - ^run my_npc_path npc:<entry[mynpc].created_npc> def:<^npc>
                    - ^run my_npc_talk npc:<entry[mynpc].created_npc>
                    - zap 2

                2:
                    trigger: /Non/ pas envie
                    script:
                    - chat "Tcho"
my_npc_path:
    type: task
    defintions: masternpc
    script:
    - ^flag <npc> step:1
    - ~walk <def[masternpc].anchor[spot1]> auto_range
    - ^inject my_npc_trypause
    - flag <npc> step:2
    - ~walk <def[masternpc].anchor[spot2]> auto_range
    - ^inject my_npc_trypause
    - flag <npc> step:3
    - ~walk <def[masternpc].anchor[spot3]> auto_range
    - wait 1
    - remove <npc>
    - adjust <player> show_entity:<def[masternpc]>
    - zap 1 script:s@my_npc_interact

my_npc_trypause:
    type: task
    script:
    - ^while <npc.location.distance[<player.location>].is[OR_LESS].than[5]> {
        - chat "Blablabla"
        - wait 1
    }

my_npc_talk:
    type: task
    script:
    - chat "Salut et bienvenue"
    - wait 2
    - chat "C'est trop cool ici"
    - while <npc.flag[step].is[OR_LESS].than[1]> {
        -wait 1
    }
    - chat "Ici c'est aussi pas mal je trouve"