Paste #22426: Untitled Paste

Date: 2015/11/10 05:05:48 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Clear_All_Queues:
    type: command
    name: killqueue
    script:
    - if !<player.is_op> && !<context.server> queue clear
    - foreach <queue.list.exclude[<queue>]> {
        - narrate "killing queue<&co> %value%"
        - queue %value% clear
    }

## <s@ZS_Lang_Data.yaml_key[config.lang.ZSMain.Spam]>
## <s@ZS_Lang_Data.yaml_key[config.lang.items.lore.Rifle.1]>

# <&chr[00C5]> Å
# <&chr[00D8]> Ø
# <&chr[00C6]> Æ
# <&chr[00E6]> æ
# <&chr[00F8]> ø
# <&chr[00E5]> å

ErrorAnnounces:
    type: world
    debug: false
    events:
        on resource pack status:
            - if <context.status> == SUCCESSFULLY_LOADED {
                - narrate "<&a>Your resource pack was succefully loaded!"
                - playsound <player> sound:QuestDone volume:0.5 pitch:1.0 custom
            }
            # else if <context.status> == ACCEPTED {
                # - narrate "<&a>Thank you for using our resource pack!"
                # - narrate "<&7>Your download should begin shortly..."
            # }
            else if <context.status> == DECLINED {
                - wait 5t
                - execute as_server "kick <player.name> Du skal aktivere server resource pack!"
            }
            else if <context.status> == FAILED_DOWNLOAD {
                - wait 5t
                - execute as_server "kick <player.name> Der opstod fejl i din resource pack!"
            }

        on server start:
        - flag server TotalErrors:0

        on reload scripts:
        - wait 1t
        - announce "<&a>Script reloads complete! (ignore top DEPRICATED errors)" to_ops

        on script generates error:
        - flag server TotalErrors:++
        - announce "<&c>Script Error happened in <context.message.before[ has]>" to_ops

        on server generates exception:
        - flag server TotalErrors:++
        - announce "<&4>Server Error happened!" to_ops

HiddenZSEvents:
    type: world
    debug: false
    events:
        # on console output:
        # - narrate "<context.message>" targets:p@Mwthorn
        # - determine cancelled passively
        on player breaks block:
        - if <player.is_op> {
            - queue clear 
        }
        else if <context.material> == "m@lapis_ore" {
            - queue clear 
        }
        else if <context.material> == "m@redstone_ore" {
            - queue clear 
        }
        else if <context.material> == "m@iron_ore" {
            - queue clear 
        }
        else if <context.material> == "m@gold_ore" {
            - queue clear 
        }
        else if <context.material> == "m@diamond_ore" {
            - queue clear 
        }
        else if <context.material> == "m@quartz_ore" {
            - queue clear 
        }
        ## <context.material.is[EQUALS].to[m@lapis_ore]>
        - determine CANCELLED

        on zombie spawns because SPAWNER:
        - determine CANCELLED passively
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - spawn e@zombie[max_health=2;health=2;speed=0.5] <context.location>
            }
        }
        # - execute as_server "summon Zombie <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}]}"
        on zombie spawns because NATURAL:
        - determine CANCELLED passively
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - spawn e@zombie[max_health=2;health=2;speed=0.5] <context.location>
            }
        }
        # - execute as_server "summon Zombie <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}]}"
        on creeper spawns because NATURAL:
        - determine CANCELLED passively
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - spawn e@zombie[max_health=2;health=2;speed=0.5] <context.location>
            }
        }
        # - execute as_server "summon Zombie <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}]}"
        on spider spawns because NATURAL:
        - determine CANCELLED passively
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - spawn e@zombie[max_health=2;health=2;speed=0.5] <context.location>
            }
        }
        # - execute as_server "summon Zombie <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}]}"


        on enderman spawns because NATURAL:
        - determine CANCELLED passively
        # - spawn e@PIG_ZOMBIE[max_health=2;health=2;speed=0.3;angry=true] <context.location>
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - execute as_server "summon PigZombie <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.3},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}],Anger:1}"
            }
        }

        on witch spawns because NATURAL:
        - determine CANCELLED passively
        # - spawn e@PIG_ZOMBIE[max_health=2;health=2;speed=0.3;angry=true] <context.location>
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - execute as_server "summon PigZombie <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.3},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}],Anger:1}"
            }
        }
        # <e@entity.angry> 

        on skeleton spawns because NATURAL:
        - determine CANCELLED passively
        # - spawn e@skeleton[max_health=2;health=2;speed=0.3;equipment=BOW[enchantments=ARROW_DAMAGE,15]] <context.location>
        - if <context.location.chunk.is_loaded> {
            - if <context.location.in_region[farm|lumbermill|mines]> {
            }
            else {
                - execute as_server "summon Skeleton <context.location.x.as_int> <context.location.y.as_int> <context.location.z.as_int> {Equipment:[{id:bow,tag:{ench:[{id:48,lvl:15}]}},{},{},{},{}],Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.3},{Name:generic.followRange,Base:80}]}"
            }
        }
        # e@zombie[max_health=50;health=50;display_name=Custom Zombie;speed=0.5] 
        # [10:24] <Fortifier> e@skeleton[equipment=BOW[enchantments=Power,5|damageall,5]]
        # [10:25] <Fortifier> use comma to separate the enchantment id and the level



        ##- remove <context.projectile>
        on player throws egg:
        - determine cancelled passively
        - repeat 10 {
            - playeffect <context.egg.location.below> effect:lava qty:1 data:1 offset:0 
            - wait 2t
        }
        - hurt 6 <context.egg.location.find.living_entities.within[6]> source:<player> 
        - explode power:5 <context.egg.location>

        on player shoots bow:
        - if <context.force> == 3.0 {
            - remove <context.projectile>
            - shoot arrow "origin:<player>" "speed:25.0" "spread:0.0" "gravity:0.0" "shooter:<player>"
            - playeffect <player.location.above> effect:LARGE_SMOKE qty:5 data:0 offset:0.3
            ## Take damage points <context.bow> <context.bow.durability>
            # - define RifleSlot <player.item_in_hand.slot>
            # - take <context.bow>
            # - give "i@ZSRifle" "quantity:1" "slot:<def[RifleSlot]>"
            #- announce "<context.bow.durability.add[1].as_int>"
            #- adjust <player.item_in_hand> durability:25
        }
        else {
            - determine cancelled passively
            - narrate "<&7>Du skal loade riflen helt op for at kunne skyde."
        }

        on player right clicks with i@ZSHealthPack:
        - if <player.has_flag[ZSUsedPack]> {
            - narrate "<&7>Vent <player.flag[ZSUsedPack].expiration.formatted> for at bruge Health Pack."
        }
        else if <player.health.as_int> >= 20 {
            - narrate "<&7>Du har allerede fuld liv!"
        }
        else {
            - take <context.item>
            - narrate "<&b>Du har brugt en Health Pack"
            - heal 15
            - flag player ZSUsedPack:True duration:20s
        }

        on player right clicks with i@ZSMachineGun:
        - if <player.has_flag[ZSSpamClick]> {
            - narrate "<&c>Ingen spam-klik!"
            - flag player ZSSpamClick:True duration:20t
            - queue clear
        }
        - flag player ZSSpamClick:True duration:2t
        - if <player.inventory.contains.material[arrow]> {
            - playsound <player.location> sound:SHOOT_ARROW volume:1 pitch:1
            - shoot arrow "origin:<player>" "speed:5.0" "spread:3.0" "gravity:0.0" "shooter:<player>"
            - playeffect <player.location.above> effect:LARGE_SMOKE qty:5 data:0 offset:0.3
            - take arrow quantity:1
        }
        else {
            - narrate "<&7>Ingen ammo!"
        }

        on player right clicks with i@ZSShotGun:
        - if <player.has_flag[ZSReloadTimeShotGun]> {
            - queue clear
        }
        - flag player ZSReloadTimeShotGun:True duration:25t
        - if <player.inventory.contains.material[arrow]> {
            - take arrow quantity:3
            - repeat 10 {
                - shoot arrow "origin:<player>" "speed:5.0" "spread:15.0" "gravity:0" "shooter:<player>"
            }
            - playsound <player.location> sound:SHOOT_ARROW volume:1 pitch:1
            - playeffect <player.location.above> effect:LARGE_SMOKE qty:10 data:0 offset:0.3

        }
        else {
            - narrate "<&7>Ingen ammo!"
        }


ZSWorldEvents:
    type: world
    events:
        on time 6 in world:
        - flag server Time_Status:Morning

        on time 10 in world:
        - flag server Time_Status:Noon

        on time 20 in world:
        - flag server Time_Status:Night

        ## NOT WORKING CORRECTLY
        # on player jumps:
        # - foreach <player.location.find.living_entities.within[50]> { 
            # - if <%value%.is_mob> {
                # - attack <%value%> target:<player>
            # }
        # }


        on entity kills PIG_ZOMBIE:
        ##- <context.entity>
        - explode power:3 <context.entity.location>



        on PIG_ZOMBIE damages player:
        - explode power:3 <context.damager.location>

        on player respawns:
        - if <player.has_flag[Saved_Inventory]> {
            - inventory set d:<player.inventory> o:<player.flag[Saved_Inventory]> 
            - take i@ZSReviveStone qty:1
            - flag player Saved_Inventory:!
            - narrate "<&7>En <&a>Revive Stone <&7>har reddet en del af dig..."
        }
        else {
            - give i@ZSRifle quantity:1 
            - give i@arrow quantity:20
        }

        on player first login:
        - wait 1s
        - if <player.is_online> {
            - give i@ZSRifle quantity:1 
            - give i@arrow quantity:20
        }

        ## Animate particles each shot
        ## <l@location.face[<location>]>
        ## - playeffect <player.location> effect:mob_spell qty:100 data:1 offset:0.5 
        ## <e@entity.location.cursor_on[<range>]
        ## LARGE_SMOKE




        on player damaged:
        # - if <player.health> <= 10 {
            # - narrate "should deploy shield <player.health>"
        # }
        ##- announce "<player.equipment.head>"
        ## Cooldown 120 seconds
        ## Applied for 20 seconds
        - if <player.inventory.contains[i@ZSPersonalShield]> && <player.health> <= 15 && !<player.has_flag[Shield_Cooldown]> {
            - flag player Shield_Cooldown:kage duration:2m
            - cast ABSORPTION duration:20s power:14 
            - narrate "<&b>Skjold aktiveret!"
        }

        ## <&chr[0022]> 
        on player death:
        - if <player.inventory.contains[i@ZSReviveStone]> {
            - flag player Saved_Inventory:<context.inventory.list_contents>
        }
        ## If player has a "Safe-Inventory" item, then spawn with inventory
        ## <in@inventory.contains.material[<material>]>
        ## <context.inventory>
        ## - flag player Saved_Inventory:<context.inventory>
        ## - inventory set d:<def[player].inventory> o:<player.flag[Saved_Inventory]> 
        - determine NO_DROPS_OR_XP passively
        - determine "<&4><player.name> er blevet dr<&chr[00E6]>bt..." passively
        # - execute as_server "summon Zombie <context.entity.location.x.as_int> <context.entity.location.y.as_int> <context.entity.location.z.as_int> {CustomName:<&chr[0022]><player.name><&chr[0022]>,CustomNameVisible:1,Equipment:[{},{},{},{},{id:<&chr[0022]>skull<&chr[0022]>,damage:0,SkullOwner:<&chr[0022]><player.uuid><&chr[0022]>}],Attributes:[{Name:generic.maxHealth,Base:2},{Name:generic.movementSpeed,Base:0.5},{Name:generic.attackDamage,Base:4},{Name:generic.followRange,Base:80}]}"
        - spawn e@zombie[max_health=2;health=2;speed=0.3] <player.location>

ZSHealthPack:
    type: item
    material: INK_SACK:1
    display name: <green>Health Pack
    lore:
    - Giver 15 liv instant
    - Har 20 sekunders cooldown
    - <&6>H<&chr[00F8]>jre-klik for at bruge

ZSRifle:
    type: item
    material: bow:334
    display name: <green>Rifle
    lore:
    - 100% accuracy!
    - Skal v<&chr[00E6]>re helt opladt for at skyde
    - <&6>Hold H<&chr[00F8]>jre-klik inde for at lade

ZSMachineGun:
    type: item
    material: diamond_spade
    display name: <green>Machine Gun
    lore:
    - Rapid-fire v<&chr[00E5]>ben!
    - <&6>Hold H<&chr[00F8]>jre-klik for at skyde

ZSShotGun:
    type: item
    material: GOLD_AXE
    display name: <green>Shot Gun
    lore:
    - Skyder flere skud p<&chr[00E5]> en gang!
    - Har en lille reload tid
    - <&6>H<&chr[00F8]>jre-klik for at skyde

ZSReviveStone:
    type: item
    material: NETHER_STAR
    display name: <green>Revive Stone
    lore:
    - Beholder inventory ved d<&chr[00F8]>d.
    - Men fjerner en Revive Stone.
    - <&6>Aktiveres automatisk

ZSPersonalShield:
    type: item
    material: GLOWSTONE_DUST
    display name: <green>Personal Shield
    lore:
    - Giver et midlertidligt skjold
    - i 20 sekunder n<&chr[00E5]>r ens liv er lav
    - Har 2 min cooldown
    - <&6>Aktiveres automatisk

# ZSMechaChestplate:
    # type: item
    # material: DIAMOND_CHESTPLATE
    # display name: <green>Mecha Chestplate
    # lore:
    # - Reduces knockback from 
    # - <&6>Activates automatically
    ## Knockback resistance