Paste #20926: Quest NPC

Date: 2015/10/15 14:35:17 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# Dhanri
Dhanri:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
    interact scripts:
    - 10 DhanriInteract

DhanriInteract:
    type: interact
    steps:
        1:
            click trigger:
                script:
                - if <player.has_flag[engaged]> {
                    - queue clear
                }
                else if <player.has_flag[FirstAid]> {
                    - zap step:2
                }
                else if <player.has_flag[FromTheDarkness]> {
                    - flag player engaged
                    - execute as_player "quest complete &6From_the_Darkness"
                    - wait 2s
                    - narrate format:chat "Well hello there!"
                    - wait 3s
                    - narrate format:chat "Wait, Moralleath sent you? So you are looking to get acquainted with Aladra then."
                    - wait 4s
                    - narrate format:chat "Very well. Go speak with Kaurii. I know she has been seeking aid for something."
                    - wait 2s
                    - narrate format:narrate "Dhanri points to the house directly north of where he stands."
                    - wait 2s
                    - execute as_player "quest accept &6First_Aid -npc 11 -hint I should visit &6Kaurii&f and see what she needs help with"
                    - flag player FromTheDarkness:!
                    - flag player FirstAid
                    - zap step:2
                    - flag player engaged:!
                }
                else {
                    - flag player engaged
                    - narrate format:chat "Hello, stranger!"
                    - wait 3s
                    - narrate format:chat "You are clearly new here. Are you wanting to learn more about Aladra or get right out into the wilds?"
                    - wait 2s
                    - narrate format:tip "Mention 'Learn' or 'Wilds' in chat to interact with Dhanri."
                    - flag player engaged:!
                }
            chat trigger:
                1:
                    trigger: I would like to /learn/ more about Aladra.
                    script:
                    - if <player.has_flag[engaged]> {
                        -queue clear
                    }
                    else if <player.has_flag[FirstAid] {
                        - queue clear
                    }
                    else if <player.has_flag[FromTheDarkness] {
                        - queue clear
                    }
                    else {
                        - flag player engaged
                        - narrate format:chat "Very well. Go speak with Kaurii. I know she has been looking for someone to help her look into things."
                        - wait 4s
                        - narrate format:narrate "Dhanri points to the house directly north of where he stands."
                        - execute as_player "quest accept &6First_Aid -npc 11 -hint I should visit &6Kaurii&f and see what she needs help with"
                        - flag player FirstAid
                        - flag player SpokeToDhanri
                        - flag player engaged:!
                        - zap step:2
                    }
                2:
                    trigger: I would rather go straight to the /wilds/.
                    script:
                    - if <player.has_flag[engaged]> {
                        - queue clear
                    }
                    else if <player.has_flag[FirstAid] {
                        - queue clear
                    }
                    else if <player.has_flag[FromTheDarkness] {
                        - queue clear
                    }
                    else {
                        - flag player engaged
                        - narrate format:chat "I see. You should speak to Halris, the dockmaster. He is on the path by the port."
                        - wait 3s
                        - narrate format:chat "Do not hesitate to return if you would like to help out and learn more here."
                        - flag player SpokeToDhanri
                        - flag player engaged:!
                        - zap step:2
                    }
        2:
            click trigger:
                script:
                - if <player.has_flag[engaged]> {
                    - queue clear
                }
                else if <player.has_flag[FirstAid]> || <player.has_flag[Kaurii] {
                    - flag player engaged
                    - narrate format:chat "Have you spoken with Kaurii?"
                    - wait 3s
                    - narrate format:chat "Once you help her out I will see who might have more for you to do."
                    - flag player engaged:!
                }
                else if <player.has_flag[ArtifactDiscovered]> {
                    - flag player engaged
                    - narrate format:chat "So you have helped Kaurii?"
                    - wait 3s
                    - narrate format:chat "I am glad to hear it. I hope all went well."
                    - wait 3s
                    - narrate format:chat "Now that you have helped her I have a request of my own. Are you prepared?"
                    - wait 2s
                    - narrate format:tip "Reply with 'Prepared' or 'Later' to interact with Dhanri."
                    - flag player engaged:!
                    - zap step:3
                }
                else {
                    - flag player engaged
                    - narrate format:chat "Are you ready to help some folks and learn about Aladra?"
                    - waits 4s
                    - narrate format:tip "Reply with 'Now' or 'Later' to interact with Dhanri."
                    - flag player engaged:!
                }
            chat trigger:
                1:
                    trigger: Yes, I am ready /now/.
                    script:
                    - if <player.has_flag[engaged]> {
                        - queue clear
                    }
                    else if <player.has_flag[FirstAid]> {
                        - queue clear
                    }
                    else {
                        - flag player engaged
                        - narrate format:chat "Excellent! Go speak with Kaurii. I know she has been looking for someone to help her look into things."
                        - wait 3s
                        - narrate format:narrate "Dhanri points to the house directly north of where he stands."
                        - wait 1s
                        - execute as_player "quest accept &6First_Aid -npc 11 -hint I should visit &6Kaurii&f and see what she needs help with"
                        - flag player FirstAid
                        - flag player engaged:!
                    }
                2:
                    trigger: I am not ready yet. I will return /later/.
                    script:
                    - if <player.has_flag[engaged]> {
                        - queue clear
                    }
                    else if <player.has_flag[FirstAid]> {
                        - queue clear
                    }
                    else {
                        - flag player engaged
                        - narrate format:chat "Understood. I will be here when you return!"
                        - wait 3s
                        - narrate format:narrate "Dhanri mumbles to himself, 'Not sure I could move if I tried...'"
                        - flag player engaged:!
                    }
        3:
            click trigger:
                script:
                - if <player.has_flag[engaged]> {
                    - queue clear
                }
                else {
                    - flag player engaged
                    - narrate format:chat "Are you prepared for another task?"
                    - wait 2s
                    - narrate format:tip "Reply with 'Prepared' or 'Later' to interact with Dhanri."
                    - flag player engaged:!
                }
            chat trigger:
                1:
                    trigger: Let's hear it. I am /prepared/.
                    script:
                    - if <player.has_flag[engaged]> {
                        - queue clear
                    }
                    else {
                        - flag player engaged
                        - narrate format:chat "Aces, my friend. This time I have a favor to ask of my own."
                        - wait 3s
                        - narrate format:chat "There was a cave discovered East-Southeast of here just off the coast."
                        - wait 3s
                        - narrate format:chat "One of our Slicers has been there for weeks. His name is Derinus."
                        - wait 3s
                        - narrate format:chat "Check on him and return any research he has gathered, please!"
                        - wait 2s
                        - execute as_player "quest accept &6Down_The_Rabbit_Hole -npc 27 -hint I need to find &6Derinus&f in the cave to the East"
                        - flag player FindDerinus
                        - flag player engaged:!
                        - zap step:4
                    }
                2:
                    trigger: Not right now. I'll come back /later/.
                    script:
                    - if <player.has_flag[engaged]> {
                        - queue clear
                    }
                    else {
                        - flag player engaged
                        - narrate format:chat "Understood. I will be here when you can help!"
                        - wait 3s
                        - narrate format:narrate "Dhanri mumbles to himself, 'Still not sure I could move if I tried...'"
                        - flag player engaged:!
                    }
        4:
            click trigger:
                script:
                - if <player.has_flag[engaged]> {
                    - queue clear
                }
                else if <player.inventory.contains[DerinusNotes]> = true {
                    - flag player engaged
                    - narrate format:chat "<player.name>! Tell me you've got good news about Derinus."
                    - wait 3s
                    - take DerinusNotes
                    - narrate format:narrate "Dhanri takes the notes as you update him."
                    - wait 3s
                    - narrate format:chat "This is good. It isn't what we'd hoped but still good."
                    - wait 3s
                    - narrate format:chat "I cannot thank you enough, my friend. Speak with Asair while I read up on these."
                    - wait 3s
                    - narrate format:chat "He has something very useful to teach you."
                    - execute as_player "quest complete &6A_Beautiful_Mind"
                    - flag player HoleInOneTurnIn:!
                    - flag player engaged:!
                    - zap step:5
                }
                else {
                    - random {
                        - narrate format:chat "I hope Derinus is alright. He's bad about not checking in with us."
                        - narrate format:chat "Derinus's research is important. We hope it may lead to fixing the Knife!"
                        - narrate format:chat "I'll feel a lot better once you return with that research."
                        - narrate format:chat "That cave can be hard to find. Remember, East-Southeast just up from the coast."
                    }
                }
        5:
            click trigger:
                script:
                - if <player.has_flag[engaged]> {
                    - queue clear
                }
                else {
                    - random {
                        - narrate format:chat "We are on the brink of fixing the Knife. I can just feel it."
                        - narrate format:chat "How are you faring, <player.name>? Things seem to be goin' well."
                        - narrate format:chat "Have you visited the Nether Isle? It is such a treacherous place."
                        - narrate format:chat "Derinus's notes provided a lot of insight. It's a greedy thought but I wish he found more."
                        - narrate format:chat "Sometimes it feels like all I do is stand here."
                    }
                }