Paste #3977: Untitled Paste

Date: 2014/05/02 16:59:29 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# This thing lets players pay for XP in fishing if you have mcMMO
# It was written by Wahrheit and you better believe it
# @author Wahrheit
# @version 1.0
# @last-updated August 7th 2013

"Fishing Master":
    type: assignment
    interact scripts:
    - 10 Fishing
    actions:
        on assignment:
        - teleport <npc> <npc.anchor[fishingmaster]>
        - trigger name:proximity toggle:true
        - trigger name:chat toggle:true

"Fishing Master Format":
    type: format
    format: "<gray>Old Fisherman<white><&co> <text>"

"Fishing":
    type: interact
    steps:
        'Player Seen*':
            proximity trigger:
                entry:
                    script:
                    - narrate "format:Fishing Master Format" "Well, hello there. Have you come to learn some tricks about fishing? I can teach you. Right click me."
                exit:
                    script:
                    - narrate "format:Fishing Master Format" "Thanks for visiting."
            click trigger:
                script:
                - narrate "format:Fishing Master Format" "Alright, let's get you some training. I'll give you 100 Fishing XP for 1 gold. Say how much gold you want to spend, or anything else to cancel."
                - zap 'step:Payment'
        'Payment':
            chat trigger:
                'Confirm':
                    trigger: I'd like to pay /REGEX:\d+/ gold.
                    script:
                    - flag player ChosenAmount:<context.message>
                    - if <context.message.is[OR_MORE].than[<player.money>]>
                       - narrate "format:Fishing Master Format" "Okay, let's get you trained up."
                       - execute as_server "addxp <player.name> fishing <context.message.mul[100].as_int>
                       - execute as_server "money grant <player.name> -<player.flag[ChosenAmount]>"                       
                       - narrate "format:Fishing Master Format" "All done. Enjoy." 
                       }
                       else narrate "format:Fishing Master Format" "You don't have that much gold."
                    - zap 'step:Player Seen'
                'Fail':
                    trigger: "/REGEX:.+/"
                    script:
                    - narrate "format:Fishing Master Format" "I don't think that's a number. Sorry, I can't work with that."
                    - zap 'step:Player Seen'
            click trigger:
                script:
                - narrate "format:Fishing Master Format" "Just say how much gold you want to pay for XP, or anything else to cancel."