Paste #19884: Fishing

Date: 2015/09/06 13:35:57 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#Fishing Daily
FishQA:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
    interact scripts:
    - 10 FishQI
Flagremovalfish:
    type: task
    script:
        - flag player FishQCooldown:!
        - flag player Fish:!
        - flag player Salmon:!
        - flag player Clown:!
        - flag player Puffer:!
FishQI:
    type: interact
    steps:
        1:
            click trigger:
                script:
                    - if <player.flag[FishQCooldown]> {
                        - narrate format:chatformat "No more work yet I'm afraid <player.name>, come back tomorrow"
                        }
                        - else {
                              - narrate format:chatformat "Ah, hello there!"
                              - wait 2s
                              - narrate format:chatformat "Slow day out here today, could you help me out?"
                              - wait 2s
                              - narrate format:chatformat "I'll give you a little something if you do"
                              - zap step:<util.random.int[2].to[5]>
                              }
        2:
            chat trigger:
                1: 
                    trigger: /Yes/
                    script:
                        - narrate format:chatformat "Oh, thank you!"
                        - wait 1s
                        - flag player Fish
                        - narrate format:chatformat "Today, could you fetch me ten Fish?"
                        - zap step:6
                2:
                    trigger: /No/
                    script:
                        - narrate format:chatformat "Bah, that is a shame. Maybe tomorrow eh?"
                        - zap step:1
        3:
            chat trigger:
                1:
                    trigger: /Yes/
                    script:
                        - narrate format:chatformat "Wonderful!"
                        - wait 1s
                        - narrate format:chatformat "It would be fantastic if you could fetch me five Salmon today"
                        - flag player Salmon
                        - zap step:6
                2:
                    trigger: /No/
                    script:
                        - narrate format:chatformat "Bah, that is a shame. Maybe tomorrow eh?"
                        - zap step:1
        4:
            chat trigger:
                1:
                    trigger: /Yes/
                    script:
                        - narrate format:chatformat "Excellent!"
                        - wait 1s
                        - narrate format:chatformat "I would appreciate it immensely if you caught me a Clownfish!"
                        - wait 3s
                        - narrate format:chatformat "Dont protest now! I know it is an ellusive little feller, but I only need the one!"
                        - flag player Clown
                        - zap step:6
                2:
                    trigger: /No/
                    script:
                        - narrate format:chatformat "Bah, that is a shame. Maybe tomorrow eh?"
                        - zap step:1
        5:
            chat trigger:
                1:
                    trigger: /Yes/
                    script:
                        - narrate format:chatformat "My thanks"
                        - wait 1s
                        - narrate format:chatformat "Please fetch me two Pufferfish"
                        - wait 2s
                        - narrate format:chatformat "I know, I know, they are spikey and hurt a shedload if you poke them, but its simple! Dont poke them!"
                        - flag player Puffer
                        - zap step:6
                2:
                    trigger: /No/
                    script:
                        - narrate format:chatformat "Bah, that is a shame. Maybe tomorrow eh?"
                        - zap step:1
        6:
            click trigger:
                script:
                    - narrate format:chatformat "Have you caught me the fish I asked for?"
                    - zap step:7
        7:
            chat trigger:
                1:
                    trigger: /Yes/
                    script:

                        - narrate format:chatformat "Excellent!"
                        - if <player.has_flag[Fish]>&<player.inventory.contains[349:0].quantity[10]> = true {
                            - zap step:8
                            - take fish:0 qty:10
                                - if <player.has_flag[Salmon]>&<player.inventory.contains[349:1].quantity[5]> = true {
                                    - zap step:8
                                    - take fish:1 qty:5
                                        - if <player.has_flag[Clown]>&<player.inventory.contains[349:2].quantity[1]> = true {
                                            - zap step:8
                                            - take fish:2
                                                - if <player.has_flag[Puffer]>&<player.inventory.contains[349:3].quantity[2]> = true {
                                                    - zap step:8
                                                    - take fish:3 qty:2
                                                    }
                                            }
                                    }
                            }
                                                        - else {
                                                            - narrate format:chatformat "Hmmm, that doesn't seem you have the number I asked for, try again"
                                                            - zap step:6
                                                            }
                2:
                    trigger: /No/
                    script:
                        - narrate format:chatformat "Not a problem, they are biting slow today. I'm not going anywhere!"
                        - zap step:6
        8:
            click trigger:
                script:
                    - narrate format:chatformat "Now, I promised a reward, did I not?"
                    - wait 3s
                    - give item:Loti qty:8
                    - narrate format:chatformat "There you go, now come back tomorrow if you fancy more honest work!"
                    - flag player FishQCooldown duration 23h
                    - zap step:1