Paste #44364: Untitled Paste

Date: 2017/09/11 13:33:57 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Npc_3:
    type: assignment
    actions:
         on assignment:
         - trigger name:click state:true
         - trigger name:chat state:true radius:10
    interact scripts:
    - 10 Npc_template

NpcTalk:
# Special way of makeing the npc talk to you 
    type: format
    format: "<&b><npc.name> to you<&co><&2><text>"
Npc_template:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.has_flag[npc_engaged]> queue clear
                - if <player.has_flag[timer]> {
                  - narrate "you can come back and do the quest in <player.flag[timer].expiration.formatted>"
                  - queue clear
                }
                - if <player.has_flag[kill_zombie_quest]> queue clear
                - flag player npc_engaged
                - if <player.flag[kill_zombie_quest_count]||0> >= 5 {
                  - narrate format:NpcTalk "good work"
                  # Quest reward
                  - give i@diamond
                  - flag player kill_zombie_quest_count:!
                  # Sets quest cooldown
                  - flag player timer duration:1m
                  - flag player npc_engaged:!
                  - queue clear
                }
                # Npcs quest's Text
                - narrate format:NpcTalk "Greetings,traveler"
                - wait 5t
                - narrate format:NpcTalk "Can you kill 5 zombies for me?"
                - wait 5t
                - narrate "[<&o>Type <&b><&o>Yes<&7> or <&b><&o>No<&7>]"

                - flag player npc_engaged:!

                World chat:
                        type: world
                        events:
                            1:
                                on player chats yes:
                                    script:
                                    - if <player.has_flag<player.has_flag[timer]>> {
                                    - queue clear
                                    }
                                    - if <player.has_flag[kill_zombie_quest]> queue clear
                                    - flag player npc_engaged
                                    - narrate format:NpcTalk "Okay see you"
                                    - wait 5t
                                    - narrate "[Kill 5 zombies!]"
                                    - flag player kill_zombie_quest
                                    - flag player kill_zombie_quest_count:0
                                    - flag player npc_engaged:!

                            2:
                                on player chats no:
                                    script:
                                    - if <player.has_flag[kill_zombie_quest]> queue clear
                                    - random {
                                      - narrate format:NpcTalk "come back later then"
                                      - narrate format:NpcTalk "see you soon"
                                      - narrate format:NpcTalk "goodbye"
                                      }
            # chat trigger:
                # 1:

                    # trigger: /Yes/ I accept
                    # script:
                    # - if <player.has_flag<player.has_flag[timer]>> {

                     # - queue clear
                    # }
                    # - if <player.has_flag[kill_zombie_quest]> queue clear
                    # - flag player npc_engaged
                    # - narrate format:NpcTalk "Okay see you"
                    # - wait 5t
                    # - narrate "[Kill 5 zombies!]"
                    # - flag player kill_zombie_quest
                    # - flag player kill_zombie_quest_count:0
                    # - flag player npc_engaged:!

                # 2:
                    # trigger: /No/ Thank you
                    # script:
                    # - if <player.has_flag[kill_zombie_quest]> queue clear
                    # - random {
                      # - narrate format:NpcTalk "come back later then"
                      # - narrate format:NpcTalk "see you soon"
                      # - narrate format:NpcTalk "goodbye"
                      # }

kill_zombie_quest_world:
    type: world
    events:
        on player kills zombie:
        - if !<player.has_flag[kill_zombie_quest]> queue clear
        - flag player kill_zombie_quest_count:++
        - if <player.flag[kill_zombie_quest_count]> >= 5 {
          - narrate "[return to <n@1.name>]"
          - flag player kill_zombie_quest:!
        }