Paste #2994: For Pokelinkj

Date: 2014/03/29 16:21:31 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


mycustomkilllistener:
  type: world
  events:
    # listen for zombie deaths
    on zombie death:
    # Confirm the killer is a player
    - if <context.damager> !matches player queue clear
    # set a player for easy later reference
    - define player <context.damager>
    # ensure the player is in the kill quest!
    - if <%player%.flag[in_custom_kill_quest]> != true queue clear
    # Now, compare the custom_name to ensure the zombie has the correct display name
    - if <context.entity.custom_name> != "EvilZombo" queue clear
    # increase the player's kill count
    - flag %player% custom_kill_count:++
    # if the player has enough kills, run the victory script!
    - if <%player%.flag[custom_kill_count]> == 5 run custom_kill_victory as:%player%

custom_kill_victory:
  type: task
  script:
  # remove the flag indicating they are in the quest
  - flag player in_custom_kill_quest:!
  # remove the counter too
  - flag player custom_kill_count:!
  # give the player a diamond to celebrate victory
  - give diamond