Paste #56229: Untitled Paste

Date: 2019/07/29 21:13:42 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Ian:
    type: task
    debug: true
    script:
        - narrate format:npcchat "Need something?"
        - define Options "<list[Do you need help with anything?|I'd like to browse your wares|What can you me about the town?]>"
        - foreach <[Options]>:
            - define message "<&a>[<&e>Click<&a>] <&r><[value]>" 
            - define Command "fakecommand <[loop_index]>" 
            - define Hover "<&a>[<&e>Select<&a>] <&r><[value]>" 
            - narrate <proc[MsgCommand].context[<[Message]>|<[Command]>|<[Hover]>]>
playerchat:
    type: format
    format: "<&6><player.name>:<&f><text>"
npcchat:
    type: format
    format: "<&6><npc.name>:<&f><text>"
sidebar_update:
    type: world
    events:
        on player picks up raw_salmon:
            - sidebar set "scores:1" "values:Get Salmon <InventoryTag.quanty.material[raw_salmon]>/<player.flag[get_fish]>"
        on player close inventory:
            - sidebar set "line: Raw Salmon <InventoryTag.quanty.material[raw_salmon]>/<player.flag[get_fish]>"
lore_conversation_branch:
    type: task
    debug: true
    lore_branch_option:
        - define Options "<list[Do you need help with anything?|I'd like to browse your wares|What can you me about the town?]>"
        - foreach <[Options]>:
            - define message "<&a>[<&e>Click<&a>] <&r><[value]>" 
            - define Command "fakecommand <[loop_index]>" 
            - define Hover "<&a>[<&e>Select<&a>] <&r><[value]>" 
            - narrate <proc[MsgCommand].context[<[Message]>|<[Command]>|<[Hover]>]>
initial_conversation:
    type: world
    debug: true
    events:
        on fakecommand command:
            - determine passively fulfilled
            - if <context.args.get[1]> == 1: *Shop Open Dialogue*
                - narrate format:playerchat "I need supplies"
                - stop
            - if <context.args.get[1]> == 2: *Available Quest dialogue*
                - narrate format:playerchat "I'm looking for work" 
                - wait 2s 
                - narrate format:npcchat "I need help, can you help me clear out the zombies from the graveyard?" 
                - wait 2s 
                - define Options "<list[Accept Quest|Decline Quest]>" 
                - foreach <[Options]>: 
                    - define Message "<&a>[<&e>Click<&a>] <&r><[value]>" 
                    - define Command "fakecommand <[loop_index].add[3]>" 
                    - define Hover "<&a>[<&e>Select<&a>] <&r><[value]>" 
                    - narrate <proc[MsgCommand].context[<[Message]>|<[Command]>|<[Hover]>]> 
                - stop 
            - if <context.args.get[1]> == 3:  *town lore chat*
                scripts:
                - narrate format:playerchat "What can you tell me about the town?"
                - define Options "<list[I'd like to know more about the town|What can you tell me about yourself?|What is that castle?|I'd like to talk about something else]>"
                - foreach <[Options]>:
                    - define message "<&a>[<&e>Click<&a>] <&r><[value]>"
                    - define Command "fakecommand <[loop_index]>.add[5]"
                    - define Hover "<&a>[<&e>Select<&a>] <&r><[value]>"
                    - narrate <proc[MsgCommand].context[<[Message]>|<[Command]>|<[Hover]>]>
                - stop
            - if <context.args.get[1]> == 4: *accept quest*
                - flag player get_fish:<util.random.int[10].to[50]>
                - narrate format:npcchat "Great, i need you to get me <player.flag[get_fish]> raw salmons."
                - sidebar add "title:Need Fish" "scores:1" "values:Get Salmon <InventoryTag.quanty.material[raw_salmon]>/<player.flag[get_fish]>"
                - stop
            - if <context.args.get[1]> == 5: *decline quest*
                - inject locally
                - stop
            - if <context.args.get[1]> == 6: *I'd like to know more about the town. (dialogue select)*
                scripts:
                - narrate format:playerchat "I'd like to know about the town"
                - wait 3t
                - narrate format:npcchat "This town was established a few months ago when the land was given to Lady Theresa."
                - wait 3t
                - narrate format:npcchat "It's main purpose is to be a fishing dock for the kingdom of Larden."
                - wait 3t
                - narrate format:npcchat "Not much else to say, since it's a newly established town it doesn't have much history."
                - wait 5t
                - inject locally lore_branch_option instantly
                - stop
            - if <context.args.get[1]> == 7: *What can you tell me about yourself? (dialogue select)*
                scripts:
                - narrate format:playerchat "What can you tell me about yourself?"
                - wait 3t
                - narrate format:npcchat "I'm the local fisherman, Moved here from the capital a weeks back."
                - wait 3t
                - inject locally lore_branch_option instantly
                - stop
            - if <context.args.get[1]> == 8: *What can you tell me about yourself? (dialogue select)*
                scripts:
                - narrate format:playerchat "What is that castle?"
                - wait 3t
                - narrate format:npcchat "That's the keep, Lady Theresa lives there and it also acts as the barracks."
                - wait 3t
                - inject locally lore_branch_option instantly
                - stop
            - if <context.args.get[1]> == 9:
                - inject locally Ian instantly
                - stop