You are browsing as a guest.
Login | Register
~ mcmonkey's simpler pastebin ~ Inspired by Hastebin ~ home page ~ Denizen help ~
click to use the normal pastebin instead ~ Click to make your own paste ~ click to duplicate and edit this paste


Title:
Type:
Date:
By:
Raw:
Other:
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
4800

Untitled Paste
Denizen Script
2016/11/30 13:13:50 UTC-08:00
Guest
Click here to view this paste as a raw text file | Or download the script


"TheOneAndOnlyNPCDeathEvent":
  type: world
  debug: false
  events:
    On npc dies:
    - if <npc.has_flag[Zombie]||false> == true {
      - run s@RemoveDeadFightingNPC def:<npc.id> delay:0.5s
      - if <npc.has_flag[Angreifer]> && {
        - yaml id:<player[<npc.flag[Angreifer]>]> set Stats.NPCZombieKills:+:1
        - yaml savefile:/Spieler/<player[<npc.flag[Angreifer]>]>.yml id:<player[<npc.flag[Angreifer]>]>
        }
      - if <npc.flag[ZombieInventar].as_list.size||0> > 0 {
        - foreach <npc.flag[ZombieInventar].as_list> {
          - drop %value% <npc.location> speed:1
          }
        }
      - if <math.as_int:<server.get_npcs_flagged[Zombie].size>-1||0> >= 1 {
        - determine "<gray>[Ger<&uuml>cht] Ein Super-Zombie weniger, bleiben noch <server.get_npcs_flagged[Zombie].size> <&uuml>brig."
        }
        else {
        - determine passively no_drops
        - determine "<gold>Der letzte bekannte Super-Zombie wurde get<&ouml>tet."
        }
      }

    - if <npc.has_flag[Zombie]||false> == false && <npc.name> == Zombie {
      - ^run s@RemoveDeadFightingNPC def:<npc.id> delay:1s
      - determine "<gray>[Ger<&uuml>cht] Ein inaktiver Zombie weniger D: Wir arbeiten an der Beseitigung des Fails."
      }

    - if <npc.has_flag[Soldat]> {
      - run s@ReplaceDeadSoldier def:<npc.flag[Respawnposition]> delay:10s
      - run s@RemoveDeadFightingNPC def:<npc.id> delay:1s
      - if <npc.has_flag[Angreifer]> {
        - yaml id:<player[<npc.flag[Angreifer]>]> set Stats.NPCSoldatKills:+:1
        - yaml savefile:/Spieler/<player[<npc.flag[Angreifer]>]>.yml id:<player[<npc.flag[Angreifer]>]>
        }
      - flag server NPC_Soldat_Respawnliste:->:<npc.flag[Respawnposition]>
      - determine passively no_drops
      - determine "<gray>[Ger<&uuml>cht] Es finden K<&auml>mpfe auf einer Milit<&auml>rbasis statt."
      }

RemoveDeadFightingNPC:
  type: task
  debug: true
  script:
  - execute as_server "npc remove <def[1]>"