Paste #14840: Merchant Quest Script (Still WIP, VERY MESSY)

Date: 2015/03/31 10:42:24 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


merchantquest:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
        - trigger name:proximity state:true radius:5
    interact scripts:
    - 10 merchantquest_interact

merchantquest_interact:
    type: interact
    steps:
        1:
            proximity trigger:
                entry:
                    script:
                    - if <player.has_flag[merchqu2done]> {
                        - narrate format:nchat "Wait what?! He was captured then you... Freed... Him?"
                        - narrate format:nchat "My god I totally underestimated you! Thank you so so much Sir, please take this as a token of my gratitude!"
                        - wait 1s
                        - ^flag <player> merchqu1done:!
                        - ^flag <player> merchfinish:1
                        - give money qty:1000
                        - narrate format:qchat "Congratulations <player.name>! You have earned yourself <&a>1000 Gold<&6>! Your new balance is <&a><player.balance> Gold<&6>!"
                    }
                    else if <player.has_flag[merchqu2]> {
                        - narrate format:nchat "You'd best hurry up with that package <player.name>!"
                    }
                    else if <player.flag[merchfinish]> == 1 {
                        - narrate format:nchat "Welcome back <&a><player.name><&f>! Do you wish to help me out with another task?"
                        - wait 1s
                        - narrate format:bchat "<&a>'yes'<&f> or <&a>'no'<&f>?"
                        - ^zap step:2
                    }
                    else if <player.has_flag[merchqu1]> {
                        - narrate format:nchat "Hey there, you'd better be off delivering that package to the town of Sudania! It's located around the coordinates <&a>(This is a placeholder)"
                    }
                    else if <player.has_flag[merchqu1done]> {
                        - narrate format:nchat "Well I'll Be, you came back?! Did you complete the task?"
                        - narrate "   "
                        - wait 1s
                        - narrate format:nchat "Ahaa, I can see the receipt from here! Give me that... Ah, there we go."
                        - narrate "   "
                        - wait 1s
                        - take "<player.inventory.list_contents.with_lore[Bread_Package_Receipt]>"
                        - narrate format:nchat "Here. Take this gold as payment for your help. And if you ever need more work be sure to come back!"
                        - narrate "   "
                        - wait 1s
                        - ^flag <player> merchqu1done:!
                        - ^flag <player> merchfinish:1
                        - give money qty:250
                        - narrate format:qchat "Congratulations <player.name>! You have earned yourself <&a>250 Gold<&6>! Your new balance is <&a><player.balance> Gold<&6>!"
                    }
                    else {
                        - narrate format:nchat "Well Howdy there <player.name>! You lookin' to make a few extra bucks?"
                        - wait 1s
                        - narrate format:bchat "<&a>'yes'<&f> or <&a>'no'<&f>?"
                    }
                exit:
                    script:
                    - narrate format:nchat "Come back soon <player.name>!"
            chat trigger:
                1:
                    trigger: /yes/ please! I love the moneys!
                    script:
                    - narrate format:nchat "Excellent! Let's begin then. Y'all ever heard of the town of Sudania? It's located around the coordinates <&a>(This is a placeholder)"
                    - narrate "   "
                    - wait 1s
                    - narrate format:nchat "I am supplying a small store there and I forgot my shipment of bread. Take this shipment there and give it to <&a>Input NPC Name Here?"
                    - give i@breadchest qty:1
                    - ^narrate "   "
                    - wait 1s
                    - if <player.inventory.contains.lore[A_Package_Full_Of_Bread]> {
                        - ^narrate format:bchat "Deliver Bread Package to Sudania | <&a>(This is a placeholder)"
                        - wait 1s
                        - ^narrate format:uchat "You have received The Bread Package."
                        - ^flag <player> merchqu1 
                    }
                    else {
                        - ^narrate format:bchat "Deliver Bread Package to Sudania | <&a>(This is a placeholder)"
                        - wait 1s
                        - ^narrate format:uchat "&bThe Bread Package Has Been Dropped At Your Feet."
                        - ^flag <player> merchqu1 
                    }
                2:
                    trigger: /no/ thanks. You ain't got enough money to fill my desires!
                    script:
                    - narrate format:nchat "Oh... I see how it is."
                    - zap 1

        2:
            chat trigger:
                1:
                    trigger: /yes/! I would love to help you out again!
                    script:
                    - narrate format:nchat "Goody goody! Well, this task is a little more challenging."
                    - wait 1s
                    - give i@swordchest qty:1
                    - narrate format:nchat "I need you to take this shipment of Swords to Sudania. Only issue is, it is quite heavy."
                    - if <player.inventory.contains.lore[A_Package_Of_Swords]> {
                        - ^narrate format:bchat "Deliver Sword Package to Sudania | <&a>(This is a placeholder)"
                        - wait 1s
                        - ^narrate format:uchat "You have received The Sword Package."
                        - ^flag <player> merchqu2 
                    }
                    else {

                        - ^narrate format:bchat "Deliver Sword Package to Sudania | <&a>(This is a placeholder)"
                        - wait 1s
                        - ^narrate format:uchat "&bThe Sword Package Has Been Dropped At Your Feet."
                        - ^flag <player> merchqu2                  
                    }
merchantquest1p2:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
        - trigger name:proximity state:true radius:5
    interact scripts:
    - 10 merchantquest1p2interact

merchantquest1p2interact:
    type: interact
    steps:
        1:
            proximity trigger:
                entry:
                    script:
                    - if <player.has_flag[merchqu1]> && <player.inventory.contains.lore[A_Package_Full_Of_Bread]> {
                        - ^narrate "   "
                        - narrate format:nchat "Well hello there! Are you perchance the individual who has my package?"
                        - narrate format:bchat "Answer <&a>'Yes' <&6>or <&a>'No'!"
                      }  
                    else {
                        - narrate format:nchat "Oh what a wonderful day it is!" 
                    }
                exit:
                    script:
                    - narrate format:nchat "Farewell!"
            chat trigger:
                1:
                    trigger: /yes/ I do! I have it right here!
                    script:
                    - ^narrate "   "
                    - narrate format:nchat "Oh Yes! I have had Mrs Green hammering me all morning for her fresh loaf of bread!"
                    - ^narrate "   "
                    - wait 1s
                    - narrate format:nchat "Give it here, give it here!"
                    - take "<player.inventory.list_contents.with_lore[A_Package_Full_Of_Bread]>"
                    - ^narrate "   "
                    - wait 1s
                    - narrate format:uchat "The Bread Package has been Removed from your Inventory!"
                    - give i@breadreceipt qty:1
                    - ^flag <player> merchqu1:!
                    - ^flag <player> merchqu1done
                    - ^narrate "   "
                    - wait 1s
                    - narrate format:uchat "The Bread Package Receipt has been Added to your Inventory!"
                    - narrate format:bchat "Return the receipt to the Merchant for your reward!"
                2:
                    trigger: /no/ I don't.
                    script:
                    - narrate "Aw, that's too bad. Well, maybe next time eh?"



merchantquest2p2:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:proximity state:true radius:5
        - trigger name:chat state:true
    interact scripts:
    - 10 merchantquest2p2interact
merchantquest2p2interact:
    type: interact
    steps:
        1:
            proximity trigger:
                entry:
                    script:
                    - if <player.has_flag[merchqu2]> && <player.inventory.contains.lore[A_Package_Of_Swords]> {
                        - narrate format:nchat "Oh lordy lordy lord! Will anyone please help me, this poor shopkeeper has been kidnapped!"
                        - wait 10t
                        - narrate format:nchat "Oh if only there were a warrior strong enough to help me! Oh lordy loo."
                        - wait 10t
                        - narrate format:nchat "YOU! You are carrying a package for him, don't shake your head I know you are!"
                        - narrate format:bchat "Say <&a>/yes/ <&f>or <&a>/no/<&f>!"
                      }  
                    else {
                        - narrate format:nchat "Oh what a wonderful day it is!" 
                    }
            chat trigger:
                1:
                    trigger: /yes/ I am indeed here to see him. What happened?
                    script:
                    - wait 10t
                    - narrate format:nchat "I was sitting here minding my own business when I saw several bandits enter the shop. They clubbed him on the head and ran away with him!"
                    - wait 10t
                    - narrate format:nchat "Before they left though, I heard them say something about <&a>Skull Cove Cave<&f>. I think that is where they took him! If you go there I bet you will find him!"
                    - wait 10t
                    - narrate format:nchat "Go go go! Give me that package and leave! I don't know how long you have to save him!"
                    - wait 10t
                    - narrate format:bchat "Rescue the merchant in <&a>Skull Cave<&f>! | <&a>(Placeholder)"
                    - wait 10t
                    - ^flag <player> merchvis
                    - take "<player.inventory.list_contents.with_lore[A_Package_Of_Swords]>"
                    - narrate format:uchat "Sword Chest was removed from your inventory."
                2:  
                    trigger: /no/ no... I definitely am not here to deliver these swords to him at the request of the merchant... Eh heh...
                    script:
                    - narrate format:nchat "You Fiend! I know you were sent here. LEAVE!"
                exit:
                    script:
                    - if <player.has_flag[merchantquest2p2started]> {
                        - narrate format:nchat "Please hurry!"
                    }
                    else {
                        - narrate format:nchat "Oh lord! The 'hero' abandons us!"
                    }    
merchantquest2p3:
    type: assignment
    actions:
        on assignment:
            - trigger name:chat state:true
            - trigger name:click state:true
            - trigger name:proximity state:true radius:5
    interact scripts:
    - 10 merchantquest2p3interact

##Currently being worked on
merchantquest2p3invis:
    type: assignment
    steps:
        1:
            proximity trigger:
                script:
                - if <player.has_flag[merchviscomp]> {
                    - narrate format:nchat "Placeholder"
                }
                else {
                    - adjust <server.list_online_players> hide_entity:<entry[<npc>]>
                }
merchantcaptured:
    type: assignment
    actions:
        on assignment:
            - trigger name:click state:true
            - trigger name:proximity state:true radius:5
            - trigger name:chat state:true
    interact scripts:
    - 10 merchantcapturedinteract

merchantcapturedinteract:
    type: interact
    steps:
        1:
            proximity trigger:
                entry:
                - if <player.has_flag[merchvis]> {
                    - adjust <server.list_online_players.exclude[<player>]> hide_entity:<npc>
                    - narrate format:nchat "He-Hello? Is anyone there?! Can someone help me?"
                    - wait 10t
                    - narrate "<&6>Bandit: <&f>Shut up you fool! *Slaps*"
                    - narrate format:bchat "Right Click the Captured Merchant after you have defeated all the Bandits!"
                    - ^zap 2
                }
                else {
                    - adjust <player> hide_entity:<npc>
                }
        2:
            click trigger:
                - narrate format:nchat "You... You are here to help me?"
                - narrate "<&5>*<npc.name> Sobs*"
                - wait 10t
                - narrate format:nchat "Thank the gods! I am free to leave this damned place. Please, come back to my store so I can reward you properly."
                - wait 10t
                - narrate format:bchat "Return to the Merchant's home."
                - ^flag <player> merchvis:!
                - ^flag <player> merchviscomp
                - wait 10t
                - adjust <player> hide_entity:<npc>