Paste #4198: Untitled Paste

Date: 2014/05/08 13:02:16 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Fishing: 
  type: assignment
  debug: false
  interact scripts:
  - 10 FishQuest
FishQuest:
  type: interact
  steps:
    getQuest:
      click trigger:
       script:
       # uncomment these next 2 lines to reset things
       - flag player fishing:!
       - ^listen cancel "id:Fishing Listener" 

       - if <player.flag[fishing]> == null
         {
         - chat "So, you like to fish?"
         - wait 3
         }
         else
         {
         - if <player.flag[fishing].asint> == 0
           {
           - chat "<player.name>, it would appear that you have not caught any fish yet."
           - if <player.inventory.contains[346]> || <player.item_in_hand.slot.contains[346]>
             {
             - chat "It looks like you have a fishing pole, and are all ready to catch some fish." 
             }
             else
             {
             - chat "I see you do not have a fishing <red>pole<green> on you.  Just ask if you need one."
             }
           }
           else
           {
           - chat "You have caught a total of <player.flag[fishing].asint> fish!  Well done!"
           }
         }
      chat trigger:
        1:
          trigger: /Yes/, I love to fish.
          script: 
          - flag player fishing:0
          - listen item 'id:Fishing Listener' type:fish item:349 qty:1 'script:FishCheck'
          - if <player.inventory.contains[346]>
            {
            - chat "It looks like you have a fishing pole, and are all ready to catch some fish." 
            }
            else
            {
            - chat "I see you do not have a fishing <red>pole<green> on you.  Just ask if you need one."
            }
        2:
          trigger: /No/, I hate fishing.
          script:
          - chat "Fishing is such a waste of time, isn't it."
        3:
          trigger: Fishing /pole/.
          script:
          - if <player.inventory.contains[346]>
            {
            - chat "You already have a fishing pole."
            }
            else
            {
            - give item 346 qty 1
            }
      proximity trigger:
        exit:
          script:
          - chat "You have left my docks.  Any fishing you do elsewhere will not count."

FishCheck:
  type: task
  script:
  - flag player fishing:++
  - chat "Yay! You caught a fish!"
  # Will have to see if we have to re-trigger listening again
  - listen item 'id:Fishing Listener' type:fish item:349 qty:1 'script:FishCheck'