Paste #31238: Untitled Paste

Date: 2016/03/05 08:07:17 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CustomQuestGUI:
    type: assignment     
    actions:     
        on click:          
        - inventory open d:in@QuestGUI   
        - flag server "currentplayeropen:<player>"  
        - inject QuestRewards  
QuestGUI:
  type: inventory  
  inventory: chest  
  title: "<&6><&l>Quest Master"  
  size: 63   
  definitions:  
    border: i@border_item  
    return_button: i@return_button   
    CoalOreQuest: i@CoalOreQuest  
    IronOreQuest: i@IronOreQuest  
    GoldOreQuest: i@GoldOreQuest  
    ResetFlags: i@ResetFlags  
  slots:  
    - "[border] [border] [border] [border] [border] [border] [border] [border] [border]"    
    - "[border] [] [] [] [] [] [] [] [border]"    
    - "[border] [] [CoalOreQuest] [] [IronOreQuest] [] [GoldOreQuest] [] [border]"    
    - "[border] [] [] [] [] [] [ResetFlags] [] [border]"    
    - "[border] [] [] [] [] [] [] [] [border] "    
    - "[border] [] [] [] [] [] [] [] [border] "   
    - "[border] [border] [border] [border] [border] [border] [border] [border] [return_button]"    


GUI_Inventory_World:
  type: world  
  events:  
    on player clicks in QuestGUI:
    - determine cancelled  
    on player clicks ResetFlags in QuestGUI:
    - Inject ResetQuestFlags  
    - narrate "<&a>All quests have now been reset."  
    on player clicks CoalOreQuest in QuestGUI:
    - if <player.has_flag[coal_ore_quest_cooldown]> {    
      - narrate "<&7><&o>You can repeat this quest in <player.flag[coal_ore_quest_cooldown].expiration.formatted>"    
      - queue clear  
    }  
    - if <player.has_flag[Quest_Log_Count]> {  
      - narrate "<&6>Your Quest log is full! Return your current quests to accept new ones."  
      - queue clear   
    }  
    - flag player Quest_Log_Count:++  
    - flag player coal_ore_quest  
    - flag player coal_ore_quest_count:0  
    - narrate "<&6>-=+ Break <&7>64 <&6>Coal Ore +=-"  
    - narrate "<&a><player.flag[coal_ore_quest_count].round||0> Coal Ores mined!"  
    on player breaks coal_ore:
    - if <player.has_flag[coal_ore_quest]> {  
      - flag player coal_ore_quest_count:++  
      - narrate "<&a>You have mined <player.flag[coal_ore_quest_count].round> Coal Ore!"  
      - if <player.flag[coal_ore_quest_count]> >= 64 {    
        - narrate "<&6>[Return to the Quest Master]"  
        - flag player gold_ore_quest:!          
      }  
    }  
    on player clicks IronOreQuest in QuestGUI:
    - if <player.has_flag[iron_ore_quest_cooldown]> {    
      - narrate "<&7><&o>You can repeat this quest in <player.flag[iron_ore_quest_cooldown].expiration.formatted>"    
      - queue clear  
    }  
    - if <player.has_flag[Quest_Log_Count]> {  
      - narrate "<&6>Your Quest log is full! Return your current quests to accept new ones."  
      - queue clear   
    }  
    - flag player Quest_Log_Count:++  
    - flag player iron_ore_quest  
    - flag player iron_ore_quest_count:0  
    - narrate "<&6>-=+ Break <&f>32<&6>Iron Ore +=-"  
    - narrate "<&a><player.flag[iron_ore_quest_count].round||0> Iron Ores mined!"  
    on player breaks iron_ore:
    - if <player.has_flag[iron_ore_quest]> {  
      - flag player iron_ore_quest_count:++  
      - if <player.flag[iron_ore_quest_count]> <= 32 {  
        - narrate "<&a>You have mined <player.flag[iron_ore_quest_count].round> Iron Ore!"  
      }  
      - if <player.flag[iron_ore_quest_count]> >= 32 {    
        - narrate "<&6>[Return to the Quest Master]"   
        - flag player iron_ore_quest:!  
      }  
    }  
    on player clicks GoldOreQuest in QuestGUI:
    - if <player.has_flag[gold_ore_quest_cooldown]> {    
      - narrate "<&7><&o>You can repeat this quest in <player.flag[gold_ore_quest_cooldown].expiration.formatted>"    
      - queue clear  
    }  
    - if <player.has_flag[Quest_Log_Count]> {  
      - narrate "<&6>Your Quest log is full! Return your current quests to accept new ones."  
      - queue clear   
    }  
    - flag player Quest_Log_Count:++  
    - flag player gold_ore_quest  
    - flag player gold_ore_quest_count:0  
    - narrate "<&6>-=+ Break <&6>128 <&6>Gold Ore +=-"  
    - narrate "<&a><player.flag[gold_ore_quest_count].round||0> Gold Ores mined!"  
    on player breaks gold_ore:
    - if <player.has_flag[gold_ore_quest]> {  
      - flag player gold_ore_quest_count:++  
      - if <player.flag[gold_ore_quest_count]> <= 128 {  
        - narrate "<&a>You have mined <player.flag[gold_ore_quest_count].round> Gold Ore!"  
      }  
      - if <player.flag[gold_ore_quest_count]> >= 128 {    
        - narrate "<&6>[Return to the Quest Master]"   
        - flag player gold_ore_quest:!  
      }  
    }  
border_item:
    type: item    
    material: i@black_stained_glass_pane    
    display name: <white><&sp>    

return_button:
    type: item    
    material: i@redstone_torch_on    
    display name: "<&6><&l>Close Menu"    
ResetFlags:
    type: item  
    material: i@string  
    display name: "<&a><&l>Reset Quests"  
    lore:  
    - "<&c><&l>NOTE:<&c> Resetting Quests will completely ERASE all Quest data from your profile."  
    - "<&c>ALL quest cooldowns get put on their original timers to prevent abusing this feature."  
CoalOreQuest:
    type: item  
    material: i@coal_ore  
    display name: "<&7><&o>Industrialized"  
    lore:  
    - "<&a>Mine <&7>64<&a> Coal Ore!"  
    - "<&6>Cooldown:<&7><&o> <server.flag[currentplayeropen].as_player.flag[coal_ore_quest_cooldown].expiration.formatted.replace[forever].with[0 seconds]||48 Hours>"  
    -
    - "<&6>Quest Reward:<&e><&o> $30,000
IronOreQuest:
    type: item  
    material: i@iron_ore 
    display name: "<&f><&o>Factorization"  
    lore:  
    - "<&a>Mine <&7>32<&a> Iron Ore!"  
    - "<&6>Cooldown:<&7><&o> <server.flag[currentplayeropen].as_player.flag[iron_ore_quest_cooldown].expiration.formatted.replace[forever].with[0 seconds]||48 Hours>"  
    -
    - "<&6>Quest Reward:<&e><&o> $65,000
GoldOreQuest:
    type: item  
    material: i@Gold_pickaxe  
    display name: "<&6><&o>Gold Mining!"  
    lore:  
    - "<&a>Mine <&7>6<&a> Gold Ore!"  
    - "<&6>Cooldown:<&7><&o> <server.flag[currentplayeropen].as_player.flag[gold_ore_quest_cooldown].expiration.formatted.replace[forever].with[0 seconds]||48 Hours>"  
    -
    - "<&6>Quest Reward:<&e><&o> $120,000

QuestRewards:
    type: task  
    script:  
    - if <player.has_flag[gold_ore_quest_cooldown].not||true> {  
      - if <player.flag[gold_ore_quest_count]||0> >= 128 {  
        - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!"  
        - narrate "<&2>$120,000 has been added to your account."  
        - give money qty:120000  
        - flag player Quest_Log_Count:!  
        - flag player gold_ore_quest_count:!  
        - flag player gold_ore_quest:!  
        - flag player gold_ore_quest_cooldown duration:48h  
        - inventory close 
        - queue clear 
      } 
    } 
    - if <player.has_flag[iron_ore_quest_cooldown].not||true> { 
      - if <player.flag[iron_ore_quest_count]||0> >= 32 {  
        - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!"  
        - give xp quantity:800  
        - narrate "<&2>$65,000 has been added to your account."  
        - give money qty:65000  
        - flag player Quest_Log_Count:!  
        - flag player iron_ore_quest_count:!  
        - flag player iron_ore_quest:!  
        - flag player iron_ore_quest_cooldown duration:48h  
        - inventory close  
        - queue clear  
      } 
    }  
    - if <player.has_flag[coal_ore_quest_cooldown].not||true> { 
      - if <player.flag[coal_ore_quest_count]||0> >= 64 {  
        - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!"    
        - narrate "<&2>$30,000 has been added to your account."  
        - give money qty:30000
        - flag player Quest_Log_Count:!  
        - flag player coal_ore_quest_count:!  
        - flag player coal_ore_quest:!  
        - flag player coal_ore_quest_cooldown duration:24h  
        - inventory close  
        - queue clear  
      } 
ResetQuestFlags:
    type: task  
    script:  
    - flag <player> Quest_Log_Count:!      
    - flag player Quest_Log_Count:!  
    - flag player gold_ore_quest_count:!  
    - flag player gold_ore_quest:!  
    - flag player gold_ore_quest_cooldown duration:48h  
    - flag player iron_ore_quest_count:!  
    - flag player iron_ore_quest:!  
    - flag player iron_ore_quest_cooldown duration:48h  
    - flag player coal_ore_quest_count:!  
    - flag player coal_ore_quest:!  
    - flag player coal_ore_quest_cooldown duration:48h