Paste #75698: Untitled Paste

Date: 2020/09/15 21:37:05 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


MobSpawningEvent:
  type: world
  debug: false
  events:
    on system time secondly every:7:
    - define disabledSpawnAreas <list[]>
    - foreach <server.online_players> as:targetPlayer:
      - define area <[targetPlayer].flag[ActiveArea]||null>
      - if <yaml[areainfo].read[<[Area]>.Hostile]||false> == true:
        - define disabledSpawnAreas <[disabledSpawnAreas].include[<[area]>]>
    - if <server.has_flag[MobSpawnDebug]>:
      - announce "Areas with disabled spawning: <[disabledSpawnAreas]>"
NotifyAreaLocations:
  type: task
  script:
  - foreach <server.online_players> as:targetPlayer:
    - define area <[targetPlayer].flag[ActiveArea]||null>
    - debug LOG <[area]>
    - announce "<[area]>"


StandardMobAssignment:
  type: assignment
  debug: false
  actions:
    on spawn:
    - debug LOG "Spawning a new mob <npc.name> at <npc.location>"
    - trigger name:proximity state:true cooldown:5 radius:15
    - trigger name:death
    on death:
    - if !<npc.has_flag[Template]>:
      - debug LOG "Permanently removing mob <npc.name>"
      - remove <npc>

StandardMobCombat:

  type: interact
  steps:
    1:
      click trigger:
        script:
        - some commands
      death trigger:
        script:
        - if !<npc.has_flag[Template]>:
          - debug LOG "Permanently removing mob"
          - remove <npc>