################################################################################ # # M a s t e r C h e f N P C # Feed those hungry denizens # # # Author: |Anthony| # Version: 0.1 # dScript Version: 0.9.5-b1522 # # # ################################################################################ # MasterChefNPC: type: assignment debug: false actions: on assignment: - run locally assignment instantly on spawn: - run locally spawn instantly on despawn: - run locally despawn instantly on click: - run locally click instantly on damage: - run locally damage instantly on chat: - inject locally chat instantly assignment: - trigger name:chat state:true - trigger name:click state:true - trigger name:proximity state:false - trigger name:damage state:true - vulnerable state:false - lookclose true range:5 realistic # - flag npc respawn_location: # - flag npc Pathfind.FidgetPathMaterial: # - flag npc Pathfind.FidgetHeight:1 - inject locally spawn instantly spawn: - chat "Alright, time to start work..." no_target # - run s@Fidget id:_fidgetQueue despawn: - chat "Phew... I<&sq>m glad to be done work for the day!" no_target damage: - chat "Why would you do that?" no_target click: - if { - if ]> { - follow stop - if ]> queue queue:Following_ stop - chat "Ok. I<&sq>ll wait right here..." - flag npc following:! - queue stop } else { - chat "I<&sq>m a little busy right now..." - queue stop } } else { - flag npc following: - run locally follow id:Following_ } follow: - if ! { - flag npc following:! - follow stop - queue stop } - follow target: - wait 5s - inject locally follow chat: - if { - chat "I<&sq>m a little busy right now following ..." - queue stop } - define options li@fridge|grill|sink|prep - define equipment '' - define range '' - if ! { - chat "Hey, that<&sq> s not a number!" } - if '' { - inject locally find%equipment% instantly } else { - chat "I don<&sq>t know anything about that." - queue stop } - if { - chat "I couldn<&sq>t find the %equipment%." - queue stop } - chat "I found %equipment%." - ~walk 'speed:0.6' 'radius:2.0' - chat "Ok, I made it to the %equipment%." findFridge: # The Fridge is 2 ironblocks tall with a stone button on the front of the top block - define ironBlocks - if && ! { - define locations li@ - foreach %ironBlocks% { - define iron '%value%' - if foreach next - define east '' - define west '' - define north '' - define south '' - define cardinals li@east|west|north|south - foreach %cardinals% { - define location '' - if && && { - define locations ]> } } } } findGrill: # The Grill is a trapdoor over fire - define fireBlocks - if && ! { - define locations li@ - foreach %fireBlocks% { - define fire '%value%' - if foreach next - define east '' - define west '' - define north '' - define south '' - define cardinals li@east|west|north|south - foreach %cardinals% { - define location '' - if && && { - define locations } } } } findSink: # The sink is a Cauldron full of water with a tripwire hook above - define cauldronBlocks - if && ! { - define locations li@ - foreach %cauldronBlocks% { - define cauldron '%value%' - if foreach next - define east '' - define west '' - define north '' - define south '' - define cardinals li@east|west|north|south - foreach %cardinals% { - define location '' - if && && { - define locations } } } } findPrep: # The Prep station is the top half stone slab - define prepBlocks - if && ! { - define locations li@ - foreach %prepBlocks% { - define prep '%value%' - if foreach next - define east '' - define west '' - define north '' - define south '' - define cardinals li@east|west|north|south - foreach %cardinals% { - define location '' - if && && { - define locations } } } } findOven: # The oven is a furnace findStove: # The Stove is a furnace with a stone pressure plate on top