Paste #32226: Untitled Paste

Date: 2016/04/02 07:32:37 UTC-07: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:  
    return_button: i@return_button   
    CoalOreQuest: i@CoalOreQuest  
    IronOreQuest: i@IronOreQuest  
    GoldOreQuest: i@GoldOreQuest  
    StoneQuest: i@StoneQuest
    ResetFlags: i@ResetFlags  
    LapisQuest: i@LapisQuest
    DiamondQuest: i@DiamondQuest
  slots:  
    - "[] [] [] [] [] [] [] [] []"    
    - "[] [StoneQuest] [] [CoalOreQuest] [] [IronOreQuest] [] [GoldOreQuest] []"    
    - "[] [] [] [] [] [] [] [] []"    
    - "[] [LapisQuest] [] [DiamondQuest] [] [] [ResetFlags] [] []"    
    - "[] [] [] [] [] [] [] [] [] "    
    - "[] [] [] [] [] [] [] [] [] "   
    - "[] [] [] [] [] [] [] [] [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:++  
      - 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 {  
      }  
      - 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 {  
      }  
      - if <player.flag[gold_ore_quest_count]> >= 128 {    
        - narrate "<&6>[Return to the Quest Master]"   
        - flag player gold_ore_quest:!  
      }  
    }  
    on player clicks StoneQuest in QuestGUI:
    - if <player.has_flag[stonequest_cooldown]> {    
      - narrate "<&7><&o>You can repeat this quest in <player.flag[stonequest_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 StoneQuest  
    - flag player StoneQuest_count:0  
    - narrate "<&6>-=+ Break <&6>192<&6> Stone Ore +=-"  
    - narrate "<&a><player.flag[StoneQuest_count].round||0> Stone Ores mined!"  
    on player breaks stone:
    - if <player.has_flag[StoneQuest]> {  
      - flag player StoneQuest_count:++  
      - if <player.flag[StoneQuest_count]> <= 192 {    
      }  
      - if <player.flag[StoneQuest_count]> >= 192 {    
        - narrate "<&6>[Return to the Quest Master]"   
        - flag player StoneQuest:!  
      }  
    }  
    on player clicks LapisQuest in QuestGUI:
    - if <player.has_flag[Lapisquest_cooldown]> {    
      - narrate "<&7><&o>You can repeat this quest in <player.flag[lapisquest_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 LapisQuest  
    - flag player LapisQuest_count:0  
    - narrate "<&6>-=+ Break <&6>384<&6> Lapis Ore +=-"  
    - narrate "<&a><player.flag[LapisQuest_count].round||0> Lapis Ores mined!"  
    on player breaks 21:
    - if <player.has_flag[lapisQuest]> {  
      - flag player LapisQuest_count:++   
      }  
      - if <player.flag[LapisQuest_count]> >= 384 {    
        - narrate "<&6>[Return to the Quest Master]"   
        - flag player LapisQuest:!  
      }  
    }  
    on player clicks DiamondQuest in QuestGUI:
    - if <player.has_flag[Diamondquest_cooldown]> {    
      - narrate "<&7><&o>You can repeat this quest in <player.flag[Diamondquest_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 DiamondQuest  
    - flag player DiamondQuest_count:0  
    - narrate "<&6>-=+ Break <&6>512<&6> Diamond Ore +=-"  
    - narrate "<&a><player.flag[DiamondQuest_count].round||0> Diamond Ores mined!"  
    on player breaks diamond_ore:
    - if <player.has_flag[DiamondQuest]> {  
      - flag player DiamondQuest_count:++   
      }  
      - if <player.flag[DiamondQuest_count]> >= 512 {    
        - narrate "<&6>[Return to the Quest Master]"   
        - flag player DiamondQuest:!  
      }  
    }  
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"  
    - "<&c> ERASE all Quest data from your profile and putting them all on cooldown."  
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]||24 Hours>"  
    - "<&e>Ore Count: <player.flag[Coal_Ore_Quest_Count]||0 Ores Mined!>"
    - "<&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]||24 Hours>"  
    - "Ore Count: <player.flag[Iron_Ore_Quest_Count]||0 Ores Mined!>"
    - "<&6>Quest Reward:<&e><&o> $65,000"
GoldOreQuest:
    type: item  
    material: i@Gold_ore
    display name: "<&6><&o>Gold Mining!"  
    lore:  
    - "<&a>Mine <&7>128<&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>"  
    - "Ore Count: <player.flag[Gold_Ore_Quest_Count]||0 Ores Mined!>"
    - "<&6>Quest Reward:<&e><&o> $120,000"
StoneQuest:
    type: item  
    material: i@stone
    display name: "<&6><&o>Cave Mining!"  
    lore:  
    - "<&a>Mine <&7>192<&a> Stone Blocks!"  
    - "<&6>Cooldown:<&7><&o> <server.flag[currentplayeropen].as_player.flag[stone_quest_cooldown].expiration.formatted.replace[forever].with[0 seconds]||24 Hours>"  
    - "Ore Count: <player.flag[StoneQuest_Count]||0 Ores Mined!>"
    - "<&6>Quest Reward:<&e><&o> $15,000"
LapisQuest:
    type: item  
    material: i@21
    display name: "<&6><&o>Experienced Miner!"  
    lore:  
    - "<&a>Mine <&7>384<&a> Lapis Ores!"  
    - "<&6>Cooldown:<&7><&o> <server.flag[currentplayeropen].as_player.flag[lapis_quest_cooldown].expiration.formatted.replace[forever].with[0 seconds]||48 Hours>"  
    - "Ore Count: <player.flag[LapisQuest_Count]||0 Ores Mined!>"
    - "<&6>Quest Reward:<&e><&o> $150,000"
DiamondQuest:
    type: item  
    material: i@diamond_ore
    display name: "<&6><&o>Going Deep!"  
    lore:  
    - "<&a>Mine <&7>512<&a> Diamond Ores!"  
    - "<&6>Cooldown:<&7><&o> <server.flag[currentplayeropen].as_player.flag[diamond_quest_cooldown].expiration.formatted.replace[forever].with[0 seconds]||48 Hours>"  
    - "Ore Count: <player.flag[DiamondQuest_Count]||0 Ores Mined!>"
    - "<&6>Quest Reward:<&e><&o> $500,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:12h  
        - 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  
      } 
    }
    - if <player.has_flag[stonequest_cooldown].not||true> { 
      - if <player.flag[stonequest_count]||0> >= 192 {  
        - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!"    
        - narrate "<&2>$15,000 has been added to your account."  
        - give money qty:15000
        - flag player Quest_Log_Count:!  
        - flag player stonequest_count:!  
        - flag player stonequest:!  
        - flag player stonequest_cooldown duration:24h  
        - inventory close  
        - queue clear  
      } 
    }
    - if <player.has_flag[lapisquest_cooldown].not||true> { 
      - if <player.flag[lapisquest_count]||0> >= 384 {  
        - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!"    
        - narrate "<&2>$150,000 has been added to your account."  
        - give money qty:150000
        - flag player Quest_Log_Count:!  
        - flag player lapisquest_count:!  
        - flag player lapisquest:!  
        - flag player lapisquest_cooldown duration:24h  
        - inventory close  
        - queue clear  
      }
    }
    - if <player.has_flag[diamondquest_cooldown].not||true> { 
      - if <player.flag[diamondquest_count]||0> >= 384 {  
        - narrate "<&6>Highlord: <&7><&o>Great work! Here's your reward!"    
        - narrate "<&2>$500,000 has been added to your account."  
        - give money qty:500000
        - flag player Quest_Log_Count:!  
        - flag player diamondquest_count:!  
        - flag player diamondquest:!  
        - flag player diamondquest_cooldown duration:48h
        - 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  
    - flag player Quest_Log_Count:!  
    - flag player lapisquest_count:!  
    - flag player lapisquest:!  
    - flag player lapis_quest_cooldown duration: 24h
    - flag player diamondquest_count:!  
    - flag player diamondquest:!  
    - flag player diamond_quest_cooldown duration: 12h