Paste #42787: Edit of P#42786 - Untitled Paste

Date: 2017/06/22 10:20:18 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:<npc>
                    - ^adjust <server.list_online_players.exclude[<player>]> hide_entity:<entry[mynpc].created_npc>
                    - ^run my_npc_path npc:<entry[mynpc].created_npc> def:<^npc> instantly
                    - zap 2

                2:
                    trigger: /Non/ pas envie
                    script:
                    - chat "Tcho"
my_npc_path:
    type: task
    defintions: masternpc
    script:
    - chat "Salut et bienvenue"
    - wait 2s
    - while <npc.location.distance[<def[masternpc].anchor[plop1]>].is[OR_MORE].than[2]> {
    - ~walk <def[masternpc].anchor[plop1]> auto_range
    }
    - ^inject my_npc_trypause
    - chat "C'est trop cool ici"
    - wait 2s
    - while <npc.location.distance[<def[masternpc].anchor[plop2]>].is[OR_MORE].than[2]> {
    - ~walk <def[masternpc].anchor[plop2]> auto_range
    }
    - ^inject my_npc_trypause
    - chat "Ici c'est aussi pas mal je trouve"
    - wait 2s
    - while <npc.location.distance[<def[masternpc].anchor[plop3]>].is[OR_MORE].than[2]> {
    - ~walk <def[masternpc].anchor[plop3]> auto_range
    }
    - wait 1s
    - 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 1s
    }