Paste #13958: Untitled Paste

Date: 2015/02/21 12:45:42 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


General:
  type: world
  events:
    on server start:
    - chunkload add location:-1345,70,-73,survive duration:-1s
    - chunkload add location:-1825,64,-421,survive duration:-1s
    - chunkload add location:-1227,67,-83,survive duration:-1s
    - chunkload add location:-1384,65,-10,survive duration:-1s
    - note "cu@-1250,11,-141,survive|-1187,125,-19,survive" as:msfarm1
    - note "cu@-1399,11,-89,survive|-1250,125,44,survive" as:mistyshores
    - note "cu@-1396,64,-37,survive|-1366,76,3,survive" as:msstables
    - note "cu@-1429,11,-119,survive|-1220,125,74,survive" as:msborder
    - note "cu@-1288,56,-48,survive|-1266,61,-24,survive" as:mschurchcrypt
    - note "cu@-1293,49,-33,survive|-1274,52,-23,survive" as:mslowercrypt
    - note "l@-1277.0,51.0,-35.0,survive" as:mscryptboss
    - note "cu@-1611,11,-579,survive|-1318,125,-312,survive" as:agarthas
    - note "cu@-1591,11,-311,survive|-1159,125,-90,survive" as:glisteningwoods
    - note "cu@-1363,68,-223,survive|-1333,86,-90,survive" as:glisteningwoodspath1
    - note "cu@-1415,68,-285,survive|-1338,86,-224,survive" as:glisteningwoodspath2
    - note "cu@-1865,39,-475,survive|-1784,81,-410,survive" as:vestahut
#   /ex showfake glass <cu@msborder.get_outline> duration:10s
    - if <global.flag[mslowercryptboss]> == dead ^run s@MSLowerCryptBossRespawn
    - run s@MSPriestSealCrypt

    on 20:00 in survive:
    # - ^run "script:MS Zombie Horde Event"

    on player join:
    - ^if <queue.exists[runichealing]> ^queue resume
    - ^if <player.is_op> {
       - ^narrate "<&5>WELCOME OPERATOR!"
       - ^health <player> 100
       - ^adjust <player> health_scale:40 }
       else { 
       - ^health <player> 100
       - ^adjust <player> health_scale:40 }
    - ^if <player.flag[msstable_nonpayment]> {
       - ^run s@narrate_msstable_nonpayment delay:3
       - ^flag <player> msstable_nonpayment:! }

    on player quit:
    - ^if <queue.exists[runichealing]> ^queue pause

narrate_msstable_nonpayment:
  type: task
  script:
  - ^narrate "<red>Your horse was removed from it's horse stall due to non-payment!!  Balance<&co> <&a>$<player.money>" targets:<player>

Heal:
  type: world
  debug: false
  events:
    on player heals:
    - ^if <context.reason> != "SATIATED" ^narrate "YOU were healed for <context.amount.asint>"

Damage:
  type: world
  debug: false
  events:
    on player shoots i@yewbow:
    - shoot arrow origin:<player> speed:<context.force>

    on player damaged by THORNS:
    - ^narrate "<red>YOU were injured for <context.damage.asint> damage by thorns!"

    on player damaged by MAGIC:
    - ^narrate "<red>YOU were injured for <context.damage.asint> magic damage!"

    on player damaged by POISON:
    - ^narrate "<red>YOU were poisoned for <context.damage.asint> damage!"

    on player damaged by FALL:
    - ^narrate "<red>YOU fell for <context.damage.asint> damage!"

    on player damaged by LAVA:
    - ^narrate "<red>YOU were burned for <context.damage.asint> damage!"

    on player damaged by FIRE:
    - ^narrate "<red>YOU were burned for <context.damage.asint> damage!"

    on player damaged by FIRE_TICK:
    - ^narrate "<red>YOU were burned for <context.damage.asint> damage!"

    on player damaged by BLOCK_EXPLOSION:
    - ^if <cu@mslowercrypt.is_within[<player.location>]> ^inject s@MSLowerCryptExplodeDamage
       else ^narrate "<red>YOU were injured for <context.damage.asint> damage!"

    on player damaged by LIGHTNING:
    - ^narrate "<red>YOU were shocked for <context.damage.asint> damage!"

    on player damaged by entity:
#--------------------------------------MINIBOSSES---------------------------------------------
    - ^if '<context.damager.custom_name.strip_color.contains[*Really Angry Skeleton]>' {
       - ^determine <proc[ReallyAngrySkeletonAttack].context[<player>|<context.damager>]> }
#----------------------------------------BOSSES-----------------------------------------------
    - ^if <context.damager> == <global.flag[mslowercryptboss]> {
       - ^determine <proc[MSLowerCryptBossAttack].context[<player>|<context.damager>]> }
    - ^if <context.damager> == <global.flag[VestatheWitch]> {
       - ^determine <proc[VestatheWitchAttack].context[<player>|<context.damager>]> }

#-------------------------------------NORMAL MOBS---------------------------------------------
    - ^if <context.damager.custom_name> != null ^narrate "<context.damager.custom_name> <red>hits YOU for <context.damage.asint> damage!"
      else if <context.damager.is_player> {
        - ^if <cu@mistyshores.is_within[<player.location>]> ^determine cancelled
        - ^narrate "<context.damager.name.display> <red>hits YOU for <context.damage.asint> damage!" }
      else if <context.damager.is_npc> ^narrate "<&4><context.damager.name.nickname> <red>hits YOU for <context.damage.asint> damage!"
      else if <context.damager.entity_type> == SPIDER ^narrate "<&7><context.damager.name> <red>bites YOU for <context.damage.asint> damage!"
      else if <context.damager.entity_type> == CAVE_SPIDER ^narrate "<&7><context.damager.name> <red>bites YOU for <context.damage.asint> damage!"
      else if <context.damager.entity_type> == BAT ^narrate "<&7><context.damager.name> <red>bites YOU for <context.damage.asint> damage!"
      else if <context.damager.entity_type> == PIG ^narrate "<&7><context.damager.name> <red>bites YOU for <context.damage.asint> damage!"
      else ^narrate "<&7><context.damager.name> <red>hits YOU for <context.damage.asint> damage!"

    on player damages entity:
    - ^if <context.entity> == <global.flag[mslowercryptboss]> || <context.entity> == <global.flag[VestatheWitch]> ^queue clear
    - define item <player.item_in_hand>
    - ^if !<proc[ValidTargetCheck].context[<player>|<context.entity>|20]> ^determine cancelled
#--------------------------------------MINIBOSSES---------------------------------------------
    - ^if '<context.entity.custom_name.strip_color.contains[*Really Angry Skeleton]>' {
       - ^inject 's@ReallyAngrySkeletonDefend'
       - ^if <proc[CustomItemCheck].context[%item%|<player>]> {
          - ^determine <proc[CustomItemDamage].context[%item%|<player>|<context.entity>|<context.cause>]> }
          else {
            - ^inject 's@NarrateDamage'
            - ^queue clear }
       }
#-------------------------------------NORMAL MOBS---------------------------------------------
    - ^if <proc[CustomItemCheck].context[%item%|<player>]> {
       - ^determine <proc[CustomItemDamage].context[%item%|<player>|<context.entity>|<context.cause>]> }
       else {
         - ^inject 's@NarrateDamage'
         - ^determine fulfilled }

Deaths:
  type: world
  debug: false
  events:
#----------------------------------------PLAYER----------------------------------------------
    # on suicide command:
    # - ^define roll <util.random.int[50].to[100]>
    # - ^flag player suicide:true
    # - ^take %roll% money
    # - ^announce "<&2><player.name> <&6>has lost $%roll% from suicide!"
    on player respawns:
    # - ^if <player.flag[suicide]> ^run 's@RespawnSuicide' delay:1
    - ^if <player.has_flag[soulbound]> ^run 's@ReturnSoulboundItems' delay:1

SoulboundProtection:
  type: world
  debug: false
  events:
    on player drops i@magicegg:
    - determine cancelled
    on player drops i@herder:
    - determine cancelled
    on player drops i@staffofbountifulharvest:
    - determine cancelled
    on player drops i@bloodsucker:
    - determine cancelled
    on player drops i@trailofembers:
    - determine cancelled
    on player drops i@mscryptpaper:
    - determine cancelled
    on player drops i@mscryptkey:
    - determine cancelled
    on player drops i@BundleofMistyShoresWheat:
    - ^determine cancelled
    on player drops i@MistyShoresWatermelon:
    - ^determine cancelled
    on player drops i@MistyShoresPumpkin:
    - ^determine cancelled
    on player drops i@sunflare:
    - determine cancelled
    on player drops i@meteorite:
    - determine cancelled
    on player drops i@merrygoround:
    - determine cancelled
    on player drops i@heartburn:
    - determine cancelled
    on player drops i@cryptstalkersword:
    - determine cancelled
    on player drops i@cryptstalkerhelm:
    - determine cancelled
    on player drops i@cryptstalkerarmor:
    - determine cancelled
    on player drops i@cryptstalkerleggings:
    - determine cancelled
    on player drops i@cryptstalkerboots:
    - determine cancelled

    on player death:
    - ^announce "<&b><player.name> <&6>has died at <player.location.simple>."
    - ^flag player tempinv:!
    - ^foreach <player.inventory.list_contents.aslist> {
       - ^if <%value%.lore> contains '<&5><&8><&1><&9><&5><&o>soulbound' ^flag player "soulbound:->:%value%"
           else ^flag player "tempinv:->:%value%
       }
    - ^if <player.equipment.helmet> != NULL {
       - ^if <player.equipment.helmet.lore> contains '<&5><&8><&1><&9><&5><&o>soulbound' ^flag player "soulbound:->:<player.equipment.helmet>"
          else ^flag player "tempinv:->:<player.equipment.helmet> }
    - ^if <player.equipment.chestplate> != NULL {
       - ^if <player.equipment.chestplate.lore> contains '<&5><&8><&1><&9><&5><&o>soulbound' ^flag player "soulbound:->:<player.equipment.chestplate>"
          else ^flag player "tempinv:->:<player.equipment.chestplate> }
    - ^if <player.equipment.leggings> != NULL {
       - ^if <player.equipment.leggings.lore> contains '<&5><&8><&1><&9><&5><&o>soulbound' ^flag player "soulbound:->:<player.equipment.leggings>"
          else ^flag player "tempinv:->:<player.equipment.leggings> }
    - ^if <player.equipment.boots> != NULL {
       - ^if <player.equipment.boots.lore> contains '<&5><&8><&1><&9><&5><&o>soulbound' ^flag player "soulbound:->:<player.equipment.boots>"
          else ^flag player "tempinv:->:<player.equipment.boots> }
    - ^if <player.flag[tempinv]> == NULL {
       - ^determine "NO_DROPS" }
       else {
         - ^narrate "<&5>* you dropped<&8><&co> <&b><player.flag[tempinv].formatted>"
         - ^determine "DROPS <player.flag[tempinv].aslist>" }


BindingStone:
  type: world
  events:
     # on player right clicks m@grass with m@diamond_hoe in mistyshores:
     # - determine cancelled
    on player left clicks emerald_block in mistyshores:
    - define mistyshores l@-1355.0,70.0,-61.0,survive
    - ^if <context.location> == %mistyshores% {
       - ^if <player.flag[respawnpoint]> == %mistyshores% {
          - ^narrate "<&3>Misty Shores Binding Stone <&8>| <&e>You are already bound to this location!"
          - ^determine cancelled }
       - ^if <player.flag[bindingstoneclicked]> {
          - ^flag player respawnpoint:%mistyshores%
          - ^playeffect l@-1355.0,70.0,-61.0,survive portal qty:100
          - ^playeffect <player.location> portal qty:150
          - ^playsound l@-1355.0,70.0,-61.0,survive effect:portal_travel volume:2.0 pitch:2
          - ^narrate "<&3>Misty Shores Binding Stone <&8>| <&e>You will now respawn here when you die!" }
          else {
            - ^flag player bindingstoneclicked duration:5
            - ^narrate "<&3>Misty Shores Binding Stone <&8>| <&e>Click again if you would like to bind here!" }
       - ^determine cancelled
       }

    on player respawns:
    - if <player.flag[respawnpoint]> == null queue clear
    - determine <player.flag[respawnpoint]>

Spawn:
  type: world
  events:
    on spawn command:
    - ^execute as_player 'mvs'
    - ^determine fulfilled

NPCSpawns:
  type: world
  events:
    on entity spawns in mistyshores:
    - if <context.entity_type> == MUSHROOM_COW || <context.entity_type> == HORSE {
      - determine cancelled }



# Temp:
  # type: task
  # script:
  # - foreach <player.location.find.entities[horse].within[1000]> {
    # - adjust %value% tame:false }

Temp:
  type: task
  script:
  - foreach <player.location.find.entities[horse].within[10]>
    - if <cu@mistyshores.is_within[<%value%.location>]> remove %value% }

# Remember, when whatever quest is completed, to run this command:
# - flag player respawnpoint:!
# To remove the respawnpoint and allow them to respawn normally 


    # - ^announce <context.reason>


    #- ^run "script:ModifyBlockTest"
    # on player damages player:
    # - ^narrate "hi" target:<context.damager>
    # - ^if <player.item_in_Hand> == i@WandofFire {
      # - ^if <context.entity.custom_name> != null ^narrate "<&f>You damaged <&c><context.entity.custom_name> <&f>for <&c><context.damage.asint> <&f><context.cause> damage!  <&8>[<&f><el@val[<math:<context.entity.health.asint>-<context.damage.asint>>].asint>/<context.entity.health.max.as_int><&8>]" targets:<player>
        # ^else ^narrate "<&f>You damaged <&c><context.entity.name> <&f>for <&c><context.damage.asint> <&f><context.cause> damage!  <&8>[<&f><el@val[<math:<context.entity.health.asint>-<context.damage.asint>>].asint>/<context.entity.health.max.as_int><&8>]" targets:<player> }


    # on entity killed:

    # on player enters cu@msborder:
    # - ^run 's@MS Zombie Horde Scoreboard'

    # on player exits cu@msborder:
    # - ^run 's@MS Zombie Horde Scoreboard' scoreboardoff

    # on player right clicks wood_button:
    #- ^run "script:ModifyBlockTest"
    # - ^define msfrontgatebuttonl <context.location>
    # - ^announce '%msfrontgatebuttonl% has been pushed!'
    # - ^announce <context.location.power>
    # - if <context.location> == l@-1343.0,71.0,-77.0,survive {
      # - run "ModifyBlockTest" }
      #- cooldown duration:15s global "script:ModifyBlockTest" }
      #- if <location.power>
      #- modifyblock location:-1346,70,-80,survive material:101 height:6 depth:1
    #  }

    # This event only runs once!
    #on server start:
    #- runtask 'daily_prizes' delay:1h
    #on player login:
    # on entity damages player:
    # - narrate "<&c><context.damager.name> <&f>hits you for <&c><context.damage> <&f>damage!" targets:<context.entity>

    #- announce '<player.name> has entered the game!'