Paste #18888: Untitled Paste

Date: 2015/07/31 22:38:49 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


BookGiveAssignment:
    type: assignment
    actions:
        on assignment:
        - trigger name:proximity state:true radius:5 cooldown:10
        - flag <npc> Sales:0
    interact scripts:
    - 10 BookGive

BookGive:
    type: interact
    steps:
        1:
            proximity trigger:
                entry:
                    script:
                    - pause navigation 45s
                    - ~look <npc> <player.location>
                    - chat "Hey, <player.name>! Would you like to buy the latest edition of the Salenia Herald?"
                    - wait 1
                    - narrate "Salenia Herald - Edition VII - Published 8/1/2015"
                    - ^narrate "Would you like to purchase a copy for $2? [Yes/No]"
                exit:
                    script:
                    - resume navigation
            chat trigger:
                1:
                    trigger: /Yes/, I would love a copy!
                    script:
                    - chat "Great! Here you go!"
                    - wait 1
                    - if <player.money> < 2 {
                      - chat "Oh no, you don't have enough money! Come back later when you've acquired enough."
                      - wait 3
                      - resume navigation
                      - zap step:1
                    }
                    - narrate "You hand <npc.name> $2 in exchange for a copy."
                    - ^take money qty:2
                    - ^scribe give script:Book
                    - wait 3
                    - chat "See you later!"
                    - wait 3
                    - resume navigation
                    - zap step:1
                2:
                    trigger: /No/, I am not interested at the moment.
                    script:
                    - chat "That's okay! If you change your mind, just look for me!"
                    - wait 3
                    - resume navigation
                    - zap step:1
                3:
                    trigger: /SALES/
                    script:
                    - chat "We've sold <npc.flag[Sales]> copies this week!"
Book:
  type: book
  title: "Herald VII"
  author: "AuburnAttack21"
  text:
  - insert text here